Varun_6_tutorial2
✓ Published0🌍 Public
This example visualizes the distribution of IMDb movie ratings across different genres using a stacked horizontal bar chart, where each bar segment represents the percentage of movies within a specific rating range. The chart is rendered using D3.js v7, with data loaded from a CSV file containing genre and rating category proportions. The visualization uses `d3.scaleBand` and `d3.scaleLinear` for axes, `d3.stack` to create the stacked segments, and `d3.scaleOrdinal` to assign colors to rating categories. Interactive tooltips provide detailed percentage values on hover, implemented through D3 event handlers and a custom HTML overlay.
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