Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Question 2

Public visualization

Question 2

0 stars0🌍 Public
Nnitishsurneni@gmail.com
Last edited Apr 6, 2025
Created on Apr 6, 2025

This visualization shows the proportional distribution of CO2 emissions by fuel type across different vehicle categories. Using a horizontal stacked bar chart, each vehicle type displays segments for Petrol, Diesel, Electric, and Hybrid fuel sources, colored with a categorical scale. The D3.js code loads data from a CSV file, stacks the fuel-type columns using the `d3.stack` API, and renders the result as SVG rectangles scaled by the linear x-axis. A legend identifies each fuel type, while the y-axis labels the vehicle types. The chart enables quick comparison of fuel-source shares within each vehicle category.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed