Skip to main content
100%

Selecting a year on a line chart using React

✓ Published0🌍 Public
FFelipe Mejías
Last edited Oct 25, 2020
Created on Oct 25, 2020
Forked from Hello VizHub

A line chart displays mental health disorder rates in Costa Rica from 1990 to 2017, with a dropdown menu to switch between seven disorder categories. The chart uses React and D3 v5, rendering an SVG with a vertical black line that follows the mouse cursor to select a year. This selection is computed by inverting the x-scale from the mouse position, and the x-axis uses a time scale with yearly ticks. Data comes from a CSV file loaded via `d3.csv`.

AI-generated description
MIT Licensed

Similar vizzes