🌍 Public
Viewing a saved revision (read-only)
de7a91a33d784f86978a185596b61c1f
Activity-6_Question-2
This example visualizes the impact of movie genres on ratings using a stacked bar chart, where each genre (represented by vegetables in the data) is broken down into rating-level percentages that sum to 1. Hovering over any segment displays a tooltip with the precise percentage for that rating category. The chart is built with D3 v7, using `d3.stack()` to create stacked bars, `d3.scaleBand()` for the y-axis, and `d3.scaleLinear()` for the x-axis. User interactions are handled through `.on('mouseover')`, `.on('mousemove')`, and `.on('mouseout')` events, with data loaded from an embedded CSV.
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.