Viewing a saved revision (read-only)
3e795314633b49eb9175fa69fa4e000a
activity 6question 2
This stacked bar chart displays the distribution of movie ratings across five genres, segmenting each genre's total percentages into five rating ranges from "Below 5.0" to "Above 8.5". The visualization uses `d3.stack()` to aggregate the data, with `d3.scaleOrdinal` assigning distinct colors to each rating category. Horizontal bars are rendered using `d3.scaleBand` for genres and `d3.scaleLinear` for the percentage axis. Interactive tooltips, implemented with mouseover events, display the exact percentage for each rating segment when hovering, enhancing the data's readability. The chart is built with D3 v7 and rendered as SVG, using data from a CSV file.
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.