Skip to main content
100%

Activity-8 Q2.3

✓ Published0🌍 Public
SSree Yuktha Sunkara
Last edited Apr 13, 2024
Created on Apr 13, 2024
Forked from Activity-6

This visualization is a stacked horizontal bar chart that displays hypothetical categories (A–E) and the percentage distribution across five rating brackets (below 10, 10-20, 20-30, 30-40, above 40). It shows how each category’s total percentage (summing to 1) is divided among the brackets using a diverging color scheme. The chart is built with D3 v7, using `d3.stack()` to compute stacked values, `d3.scaleLinear()` for the x-axis, and `d3.scaleBand()` for the categorical y-axis. Hovering over a segment reveals a tooltip with the exact percentage, implemented via D3’s selection and event handling. The SVG rendering uses a 960×500 canvas with margins and axis labels styled by the included stylesheet.

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