Skip to main content
100%

Line Chart with Circle Tooltip D3 V4

✓ Published0🌍 Public
ZZoeLeBlanc
Last edited Jul 13, 2018
Created on Jul 10, 2018

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 description

This 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:

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>

gpl-3.0 Licensed

Similar vizzes