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)

8251480d0009483fa5eb76a9461c25ff

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.