Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Pie Chart

Public visualization

Fork of Pie Chart

0 stars0🌍 Public
SSheshidharreddy
Last edited Mar 29, 2022
Created on Mar 29, 2022
Forked from Pie Chart

This visualization shows 2022 US auto sales by brand as a pie chart with a legend displaying brand names, percentage of total sales, and sales volumes in thousands. Built with d3 v5, it loads CSV data from a GitHub gist, parses the data, and uses `pie()`, `arc()`, and `scaleOrdinal()` to generate SVG path segments with distinct colors. The chart appends legend rectangles and text elements, formatting percentages and values with `format('.4~g')`. The sales values are summed to calculate percentages, and the rendering is driven by an async `getData()` function.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed