Skip to main content
100%

Line Chart with D3

✓ Published1🌍 Public
OOlha
Last edited Sep 3, 2026
Created on Mar 1, 2022

This example visualizes abortion rates for 15-17-year-olds across eight U.S. states from 1985 to 2017 as a multi-series line chart, with each state distinguished by a color-coded ordinal scale and a d3-legend. It renders using SVG with animated tooltips on circular data points that display the year, state, and rate on mouseover. The visualization is built with D3 v7, using d3.group for data nesting, d3.line for path generation, d3.scaleLinear for axes, and d3.axisBottom/Left for tick marks, drawing from CSV data loaded via d3.csv.

AI-generated description

Assignment 5 part B

Line Chart with D3

Inspired by:

And by documentation:

Tooltip shifting: for unknown reason vizhub shows tooltip shifted to the left, but locally in Chrome and Safari browsers tooltips work fine, I suspect there may be a bug in vizhub. If there is a valid explanation, please share!

MIT Licensed

Similar vizzes