Skip to main content
100%

Line chart

✓ Published0🌍 Public
Ssriram.official9@gmail.com
Last edited Mar 27, 2024
Created on Mar 25, 2024

This example displays a line chart of total sales per year, with a single steelblue path plotted against a time-scaled x-axis and a linear y-axis. The chart is a static SVG rendered in D3 v7. The code loads a CSV from a GitHub gist (titanic.csv), aggregates sales data by summing each year’s column, and uses `d3.scaleTime`, `d3.scaleLinear`, `d3.line`, and `d3.axisBottom`/`d3.axisLeft` to construct the visualization. The SVG is sized at 800x400 pixels with margins, and axis labels are added as text elements.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes