Clone of Mike Bostock's "Bar Chart II"
Placeholder README.md
This is basic responsive D3 chart example. It is a fork from Mike Bostock's bar chart "Wrapping Long Labels." This NPR article was also useful.
Changes from Mike Bostock's original in the order they were applied:
- Add default width and height
- Use those defaults to calculate non-repsonsive width and height
- Create the set_vars() function to re-calculate width and height when needed. Call it immediately to correctly set width and height
- Put the code that draws the chart in a function, drawGraphic. Basically, the code from "var x..." through "svg.selectAll("rect")..."
- Create the window.onresize funcion
In the future be able to create breakpoints to draw slightly different graphs if space is constrained.