Sample Line Chart
✓ Published0🌍 Public
This sample line chart displays US GDP data from 1980 to 2020, drawing a smooth basis curve through the points. The code uses d3.scaleLinear for both axes, d3.axisBottom and d3.axisLeft for ticks, and d3.line with curveBasis to generate the path. It loads data from a CSV hosted on GitHub, parses the numeric values, and renders the chart as SVG with red strokes and a pink background. The title and axis labels are added via d3 text elements.
AI-generated descriptionThis line chart shows one week of temperature (in degrees Celcius) in San Francisco. The data comes from Data Canvas - Sense Your City.
Made in this video:
MIT Licensed