Line Chart with Circle Tooltip D3 V4
✓ Published0🌍 Public
Aalandunning
Last edited Oct 19, 2016
Created on Sep 22, 2016
This line chart displays yearly population values from a JSON file, with a circle tooltip that follows the mouse to reveal the exact value at each data point. Built with D3 v4 and rendered as SVG, the chart uses `d3.json` to load data, `d3.timeParse` and `d3.scaleTime` for the x-axis, and `d3.line` to draw the line. A bisector and `d3.mouse` handle the interactive tooltip, which includes hover lines and a formatted y-axis showing values in thousands.
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
gpl-3.0 Licensed