Fork of Pie Chart
✓ Published0🌍 Public
This example shows a pie chart of fruit sweetness levels, with each slice labeled by fruit name and its corresponding sweetness value in a legend beside the chart. The visualization splits the data into colored segments using D3’s `pie` and `arc` generators, with colors assigned via `scaleOrdinal`. It loads CSV data from a GitHub gist using `d3.csv`, renders the chart as SVG, and displays legend entries with fruit names and formatted sweetness numbers using `d3.format`. The code uses React for component structure and D3 v5 for all data binding and visual encoding.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed