q1
✓ Published0🌍 Public
This example shows how movie genres are distributed across rating categories using a pie chart, with each slice sized according to the percentage of movies in a particular genre. It loads D3 v7 via UNPKG and uses the `d3.pie` and `d3.arc` APIs to generate the chart, with `d3.scaleOrdinal` for color encoding and `d3.select` for DOM manipulation. Interactive tooltips appear on mouseover, displaying the genre name and percentage, while text labels inside each slice show the computed percentage values. A legend is built dynamically using D3's selection and data-binding methods.
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