Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

multi-line Chart in D3

Public visualization

Viewing a saved revision (read-only)

0b729f2c8b8c4b389cdd69fac70e5a9a

multi-line Chart in D3

0 stars1🌍 Public
EEunice Tu
Last edited Mar 14, 2024
Created on Mar 11, 2024
Forked from D3 Starter

This multi-line chart visualizes the average daily cigarette consumption among smokers in the top five countries from 1980 to 2012, using data from the CORGIS smoking dataset. The chart displays five distinct colored lines, one per country, with dots marking individual yearly data points. Built with D3 v7, the visualization employs `d3.csv` to load data, `d3.group` to organize by country, and `d3.scaleLinear` for both axes. The color scale uses a ColorBrewer qualitative scheme, while the legend is generated using the d3-legend library's `d3.legendColor` function. The SVG rendering includes labeled axes and a title.

AI-generated description

A demonstration of how to start using D3 version 6.