Skip to main content
Public

Share visualization

Loading preview…

Activity6_Task2 Question 2

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Activity6_Task2 Question 2

1
Gguttavenkata745@gmail.com
Last edited Oct 18, 2024
Created on Oct 18, 2024
Forked from Activity6_Task2

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.

Comments

Sign in to join the discussion.

MIT Licensed