π Public
task 9
This visualization shows the humidity distribution among the top ten weather stations, displayed as a pie chart with labeled slices and a color-coded legend. The code loads data from a CSV file via `d3.csv`, converts humidity values to numbers, and sorts them before selecting the highest ten. Using D3 v7 APIs, it builds the chart with `d3.pie()` and `d3.arc()`, applies a categorical color scale with `d3.scaleOrdinal`, and renders labels at slice centroids. An SVG-based legend lists each station with its corresponding color and percentage.
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
Comments
Sign in to join the discussion.