linechart
✓ Published1🌍 Public
This example visualizes the cost of sales from 2000 to 2013 using a line chart rendered as an SVG. The chart is built with D3 v7, loading data from a local CSV file that contains two columns: year and cost. The code defines a band scale for the x-axis and a linear scale for the y-axis, then draws a light green line connecting the data points. Custom axis labels for "Year" and "cost" are added in red, and the chart includes styled tick text and a title.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed