🌍 Public
Viewing a saved revision (read-only)
f11187f3c27345a394ab616163f8d047
Activity7:Questions:1
This pie chart shows the distribution of fuel types among a small dataset of used cars, grouping sixteen vehicles by their fuel category: Petrol, Diesel, and CNG. Built with the Chart.js library, the code computes the count of each fuel type using a reduce function over an in-memory JavaScript array of car objects, then renders the result to a canvas element with a distinct color per fuel type. The chart displays a legend and titled heading, with a responsive layout that centers the visualization on the page.
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.