Skip to main content
Public

Share visualization

Loading preview…

Fork of Pie Chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Pie Chart

0
RRahulSai05
Last edited Apr 28, 2022
Created on Apr 28, 2022
Forked from Pie Chart

This example displays 2022 US auto sales by brand as a pie chart, with each slice’s color, percentage, and total sales in thousands labeled in a legend. It loads CSV data from a Gist URL using `d3.csv`, then uses `d3.pie` and `d3.arc` to generate the SVG paths, with `d3.scaleOrdinal` assigning colors. The legend, built with SVG rectangles and text, shows each brand’s name, percentage of total sales, and absolute count. The chart is rendered synchronously in SVG within a static HTML page, with styling defined in an external CSS file.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed