Assignment 2 Question 1
✓ Published0🌍 Public
This example shows the distribution of employees across different units as a pie chart, with percentage labels on each slice and a color-coded legend. It loads salary prediction data from a GitHub-hosted CSV file using d3.csv, then aggregates the data with d3.rollup to count observations per unit. The visualization uses d3.pie and d3.arc to generate the chart, d3.scaleOrdinal with d3.schemeCategory10 for coloring, and renders to SVG. The chart is centered via an SVG transform, with a title and legend positioned around the main graphic.
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