Assignment 2 - Stacked Bar
✓ Published0🌍 Public
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 descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed