Skip to main content
100%

Activity_6_Q3

✓ Published0🌍 Public
Ppradeepgubbala2001@gmail.com
Last edited Oct 24, 2024
Created on Oct 24, 2024
Forked from Activity_6_2

This example visualizes the distribution of energy generation percentages across five energy sources (Coal, Solar, Wind, Nuclear, Hydro, and Natural Gas) using a stacked horizontal bar chart. It shows the proportional share of each source across five percentage categories, from below 10% to above 40%. The chart uses D3 v7’s `d3.stack()` and `d3.scaleBand()`, with SVG rendering and an ordinal color scale. Hovering over any bar segment highlights it and displays a tooltip with the exact percentage value, formatted via `d3.format()`. Data comes from a locally loaded CSV file.

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.
MIT Licensed

Similar vizzes