Skip to main content
100%

Line chart from CSV using d3.js

✓ Published0🌍 Public
AAleOG
Last edited May 8, 2023
Created on May 8, 2023
Forked from HTML Starter

This example visualizes the USD to RUB exchange rate over three selectable years (2018, 2019, 2020) as an animated line chart with a filled area. It uses d3.js v6 within a React-compatible structure, rendering to SVG. Data is loaded from CSV files using `d3.csv`, with the x-axis mapped via `d3.scaleTime` and the y-axis via `d3.scaleLinear`. The line and area paths are built with `d3.line` and `d3.area` using cardinal curves, while transitions (using `transition()`) animate the axis rescaling and stroke-dasharray drawing effect. A mouse hover reveals a crosshair and highlights the nearest data point via `d3.bisector`. The source is the Moscow Exchange, linked via an embedded anchor.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes