Skip to main content
Public

Share visualization

Loading preview…

Pie Chart with Overlapping Labels

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

Pie Chart with Overlapping Labels

0
Uubl2
Last edited Mar 28, 2022
Created on Mar 23, 2022
Forked from HTML Starter

This pie chart displays the GDP of ten countries, with each slice labeled directly on the chart. The labels, however, overlap when slices are narrow or adjacent. The visualization uses D3 v4 with SVG rendering. It creates the pie layout with `d3.pie()` and draws slices using `d3.arc()`. Text labels are positioned via `arc.centroid()` and styled with Arial font. Countries and their GDP values are hardcoded, and slice colors come from a `d3.scaleOrdinal()` with a predefined color range.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed