🌍 Public
Viewing a saved revision (read-only)
26e0ff278c924ca19c10c6d8be42f2c7
Activity6_Task2
This example shows a stacked horizontal bar chart of movie ratings across six genres, using the D3.js library (v7) to portray the percentage distribution of ratings from low to high for each genre. The data, sourced from a CSV file, is rendered as SVG. The code defines ordinal color scales for the rating categories, uses linear and band scales for positioning, and adds interactive tooltips on mouseover that display the exact percentage. D3 APIs like `d3.scaleOrdinal`, `d3.scaleLinear`, `d3.scaleBand`, `d3.axisBottom`, `d3.axisLeft`, and `d3.format` are used for layout and formatting.
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.