Skip to main content
100%

Q1_Dataviz_Piechart

✓ Published0🌍 Public
Aakshaykumarmandala06@gmail.com
Last edited Mar 27, 2025
Created on Mar 26, 2025

This pie chart visualizes the average car prices across different brands, segmented by fuel type, with data loaded from a CSV file. The visualization uses D3 v6’s `d3.pie` and `d3.arc` to generate SVG path slices, while labels show the brand name and average price using `labelArc.centroid`. The chart filters Tesla to show only electric models, and a separate SVG legend maps fuel types (Petrol, Diesel, Electric, Hybrid) to distinct colors. The code processes the CSV data with `d3.group` to compute averages per brand and fuel type before rendering.

AI-generated description
MIT Licensed

Similar vizzes