Activity6_task 2 tutorial
✓ Published0🌍 Public
This example visualizes the distribution of movie ratings across genres using a stacked horizontal bar chart, where each genre is represented by a row segmented into five rating categories from “below 5.0” to “above 8.5.” The chart reads from `data.csv` and uses D3 v7’s `d3.stack()` to compute the stacked segments, with `d3.scaleOrdinal` assigning colors and `d3.scaleBand` handling the genre rows. Interactive tooltips appear on mouseover, showing the exact percentage for each rating category, while the SVG is rendered with axes, labels, and a title. The bars’ segment lengths reflect proportional percentages, making genre rating patterns immediately comparable.
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