Activity8_Task3
✓ Published0🌍 Public
This example visualizes the cost of sales from 2000 to 2013 using a line chart, with the x-axis representing each year and the y-axis showing cost values. The line is rendered as a single SVG path with a lightgreen stroke, and both axis labels are styled in red with a large font. The code loads data from a local CSV file using `d3.csv`, maps the cost values to numbers, and builds the scales with `d3.scaleBand` and `d3.scaleLinear`. The SVG chart is created via `d3.select` and positioned with margins, while axes are added using `d3.axisBottom` and `d3.axisLeft`.
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