Fork of D3 Starter -(pie chart)
✓ Published0🌍 Public
This pie chart visualizes the distribution of car horsepower into three ranges (Low ≤120 HP, Medium 121–160 HP, and High >160 HP) using data from a CarPerformance.csv dataset. The chart uses d3.csv to load the data, d3.scaleOrdinal for color encoding, and d3.pie with d3.arc to generate SVG path elements. Labels are positioned using arc centroid calculations, and a legend appears in the top-right corner. The visualization demonstrates how D3 v7 transforms tabular data into an interactive-free categorical pie chart with clean SVG rendering.
AI-generated descriptionCar Performance Pie Chart
This project visualizes vehicle horsepower distribution using D3.js.
Files
index.html→ Main HTML structurestyle.css→ Styling for layout and visualsindex.js→ D3 logic to render the pie chartCarPerformance.csv→ Dataset hosted on GitHub
Data Source
CSV hosted at:
CarPerformance.csv (GitHub Raw)
How to Run
- Open index.html in your browser, or
- Fork on VizHub, ensuring CSV URL points to GitHub Raw.
Output Preview
Pie chart showing:
- Low (≤120 HP)
- Medium (121–160 HP)
- High (>160 HP)
Legend is placed at the top-right corner for readability.
MIT Licensed