Activity6_Task2 Question 2
✓ Published1🌍 Public
This example presents a stacked bar chart depicting CO2 emissions by vehicle type (Sedan, SUV, Truck, Motorcycle) and fuel type (Petrol, Diesel, Electric, Hybrid). The visualization uses proportional data from a local CSV file, rendered as SVG rectangles. It leverages D3.js v7 APIs, including `d3.stack` for stacking series, `d3.scaleOrdinal` for color coding, `d3.scaleBand` for categorical axes, and `d3.axisLeft`/`d3.axisBottom` for labeled axes. A custom legend and title complete the chart, with all styling handled via external CSS.
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