Line Chart with Circle Tooltip D3 V4
This line chart displays population values for two cities, Charlottesville and New Haven, from 2005 to 2015, loaded from a JSON file. Built with D3 v4 and rendered as SVG, it uses d3.timeParse and d3.scaleTime for the x-axis, d3.scaleLinear for the y-axis, and d3.line to draw the population trends. A circle tooltip appears on mouseover, with dashed hover lines, using d3.bisector to find the nearest data point. The y-axis tick labels are formatted in thousands with a "k" suffix.
AI-generated descriptionThis chart is based on <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3883245'>Line Chart</a>
it uses a json file storing year values and population values. The chart employs conventional margins and a number of D3 features:
- d3.json - load and parse data
- d3.tickFormat - format y axis tick text
- d3.time.scale - x-position encoding
- d3.extent - compute domains
- d3.svg.axis - display axes
- d3.svg.line - display line shape
forked from <a href='http://bl.ocks.org/alandunning/'>alandunning</a>'s block: <a href='http://bl.ocks.org/alandunning/cfb7dcd7951826b9eacd54f0647f48d3'>Line Chart with Circle Tooltip D3 V4</a>