🌍 Public
Viewing a saved revision (read-only)
61c4510f37a549d5b398642b4c6a17ab
Assignment-2(1Q)
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