Skip to main content
Public

Share visualization

Loading preview…

Selecting a Year on a line chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Selecting a Year on a line chart

1
NNeepaB
Last edited Feb 16, 2021
Created on Feb 14, 2021
Forked from Q4

This example shows a multi-line chart tracking earthquake counts across four U.S. regions (Midwest, Northeast, South, and West) from 2010 to 2015. The code uses D3 v5 with SVG rendering and animation, loading data from a CSV file via `d3.csv`. It employs `d3.nest()` to aggregate counts by year and region, then draws separate colored lines using `d3.line()` and `d3.scaleTime()`/`d3.scaleLinear()`. A legend and axis labels are added, with the visualization built using the margin convention and React as the framework.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed