Skip to main content
100%

Fork of D3 Starter -(pie chart)

✓ Published0🌍 Public
Ssowjanya
Last edited Oct 25, 2025
Created on Oct 25, 2025

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 description

Car Performance Pie Chart

This project visualizes vehicle horsepower distribution using D3.js.

Files

  • index.html → Main HTML structure
  • style.css → Styling for layout and visuals
  • index.js → D3 logic to render the pie chart
  • CarPerformance.csv → Dataset hosted on GitHub

Data Source

CSV hosted at:
CarPerformance.csv (GitHub Raw)

How to Run

  1. Open index.html in your browser, or
  2. 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

Similar vizzes