🌍 Public
Viewing a saved revision (read-only)
df77ba5323f0456ab9da74fc30eb50dc
sample
A pie chart displays the sales distribution of four electronic items—Smartphone, Tablet, Laptop, and Smartwatch—using D3.js v7 with SVG rendering. The chart encodes sales values as arc sizes, with each slice labeled by item name and sales amount, and a positioned legend showing color-coded item categories. Built with `d3.pie` and `d3.arc`, the visualization uses `d3.scaleOrdinal` with `schemeCategory10` for colors and appends path and text elements to the SVG. The legend is constructed as HTML divs, and all data comes from a static in-memory dataset.
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.