Skip to main content
Public

Share visualization

Loading preview…

ICE7_11703795_PieChart

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

ICE7_11703795_PieChart

0
MMeghanaChowdaryVelaga@my.unt.edu
Last edited Apr 2, 2025
Created on Apr 2, 2025

This pie chart displays the distribution of smokers versus non-smokers from a health information dataset, revealed through two labeled slices. The visualization aggregates the dataset’s `smoker` column by counting occurrences of “yes” and “no” values. Using D3 v7, the code applies the `d3.pie()` layout and `d3.arc()` generator to render SVG paths, with `d3.schemeCategory10` coloring each slice. A legend, constructed manually with SVG rectangles and text, maps colors to categories. The chart loads remote CSV data via `d3.csv()` and includes a fixed 400x400 pixel SVG canvas.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed