Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Assignment-2(1Q)

Public visualization

Viewing a saved revision (read-only)

b07fdfa02b62424d8883ee75b43f7abb

Assignment-2(1Q)

0 stars0🌍 Public
SSaiHarshitManda@my.unt.edu
Last edited Mar 27, 2025
Created on Mar 25, 2025

This interactive pie chart visualizes the average car price for different brands, segmented by engine fuel type. The chart uses D3.js v6 to aggregate CSV data, grouping by brand and fuel type, then calculating the mean price for each segment. The visualization displays brand labels and average prices on each slice, with a separate HTML legend mapping fuel types to colors. The rendering uses SVG paths generated with `d3.pie()` and `d3.arc()`, with labels placed via `labelArc.centroid()`. The chart filters to show only Tesla’s electric models, and the legend is created using positioned SVG rectangles and text.

AI-generated description