Skip to main content
Public

Share visualization

Loading preview…

D3 Line Chart With Brush - Earthquakes

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

D3 Line Chart With Brush - Earthquakes

0
JJunying Li
Last edited Nov 18, 2021
Created on Nov 17, 2021

A D3 line chart visualizes global total earthquake deaths per year from 1900 to 1999, using data from a CSV of earthquake records. Circles mark individual yearly totals, connected by a steelblue line. An interactive brush (d3.brushX) allows selection along the x-axis; selected circles turn red, and double-clicking either clears the selection or selects all data if none exists. The chart uses d3.scaleLinear for both axes, d3.axisLeft, d3.axisBottom, and d3.rollup to aggregate deaths by year, rendered as SVG elements.

AI-generated description

A D3 line chart shows the global total deaths caused by earthquakes from 1900 to 1999.

Brush:

  1. Select:

In selected area, circles become red.

  1. Double click:

If user has already selected an area, user can unselect it by double clicking in this area. If user has not selected area, double click will select all circles.

Data: Earthquakes Dataset.


Y-axis:

Global total deaths in the year

X-axis:

Year

Comments

Sign in to join the discussion.

MIT Licensed