Skip to main content
100%

Assignment 2 - Stacked Bar

✓ Published0🌍 Public
Ppasyasahas
Last edited Jul 16, 2023
Created on Jul 6, 2023
Forked from Hello VizHub

A stacked bar chart displays crash ratings for 24 car makes across five rating levels, with each bar segmented by color to show the proportion of one-to-five-star ratings. Loading CSV data with values between zero and one, the visualization uses D3 v7's `d3.stack()` and `d3.scaleOrdinal` to map rating categories to colors. Hovering over a segment reveals a tooltip with the exact percentage and rating. The SVG renderer includes a legend, axis labels, and a title, styled with custom 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.
MIT Licensed

Similar vizzes