Pie and doughnut chart

Show the shares of one whole in a pie chart or a doughnut (donut) chart, with labels inside or outside, a total in the center and exploded slices.

React
import { PieChart } from 'boardplot/react/pie';
Use for
Share of a whole, few parts · Doughnut with a center total · Revenue mix by channel
Not for
Negative parts; pie divides a nonnegative whole. A negative slice is not drawn and the center total is left out.

Device revenue with center total

doughnut chart, 3 slices of Device revenue, total 250.2. Shares: Mobile 45%, PC 32%, Tablet 23%. Mobile approaches half of global device revenue Camden Devices · Revenue by device class in $bn · FY25 Source: Camden market model v4, FY25 actuals 250.2 $bn Mobile 112.3 · 45% PC 80.5 · 32% Tablet 57.4 · 23%

A doughnut chart of 250.2 billion dollars of device revenue shows Mobile at 112.3 (45%), PC at 80.5 (32%) and Tablet at 57.4 (23%), with the Mobile slice pulled out.

Download SVG Fixture IDdoughnut-device-revenue
JSON spec

This spec includes the theme shown and the options you selected.

{
  "type": "pie",
  "data": {
    "categories": [
      {
        "id": "mobile",
        "label": "Mobile"
      },
      {
        "id": "pc",
        "label": "PC"
      },
      {
        "id": "tablet",
        "label": "Tablet"
      }
    ],
    "series": [
      {
        "id": "rev",
        "label": "Device revenue",
        "values": [
          112.3,
          80.5,
          57.4
        ]
      }
    ]
  },
  "options": {
    "doughnut": 0.55,
    "explode": {
      "mobile": 0.06
    },
    "colors": "categorical",
    "format": "1,234.5",
    "title": "Mobile approaches half of global device revenue",
    "subtitle": {
      "company": "Camden Devices",
      "measure": "Revenue by device class",
      "period": "FY25"
    },
    "unit": "$bn",
    "source": "Camden market model v4, FY25 actuals"
  }
}

Streaming revenue share by genre

pie chart, 7 slices of Streaming revenue, total 96.2m. Shares: Pop 37%, Hip-hop 24%, Rock 19%, Latin 8%, Country 5%, Jazz 4%, Other 3%. Pop and hip-hop earn six of every ten streaming dollars Brevinth Music · Streaming revenue in US$ · FY25 Source: Brevinth label analytics, FY25 Pop 35.6m · 37% Hip-hop 23.1m · 24% Rock 18.3m · 19% Latin 7.7m · 8% Country 4.8m · 5% Jazz 3.8m · 4% Other 2.9m · 3%

A pie chart of $96.2m of streaming revenue shows Pop at 37% and Hip-hop at 24%, together about six in ten dollars, followed by Rock, Latin, Country, Jazz and Other.

Download SVG Fixture IDstreaming-genre-share
JSON spec

This spec includes the theme shown and the options you selected.

{
  "type": "pie",
  "data": {
    "categories": [
      {
        "id": "pop",
        "label": "Pop"
      },
      {
        "id": "hiphop",
        "label": "Hip-hop"
      },
      {
        "id": "rock",
        "label": "Rock"
      },
      {
        "id": "latin",
        "label": "Latin"
      },
      {
        "id": "country",
        "label": "Country"
      },
      {
        "id": "jazz",
        "label": "Jazz"
      },
      {
        "id": "other",
        "label": "Other"
      }
    ],
    "series": [
      {
        "id": "revenue",
        "label": "Streaming revenue",
        "values": [
          35600000,
          23100000,
          18300000,
          7700000,
          4800000,
          3800000,
          2900000
        ]
      }
    ]
  },
  "options": {
    "format": "1.2m",
    "highlight": [
      "pop",
      "hiphop"
    ],
    "title": "Pop and hip-hop earn six of every ten streaming dollars",
    "subtitle": {
      "company": "Brevinth Music",
      "measure": "Streaming revenue",
      "period": "FY25"
    },
    "unit": "US$",
    "source": "Brevinth label analytics, FY25"
  }
}

Product line mix with an Others slice

pie chart, 5 slices of Revenue, total 100. Shares: Platform 38%, Analytics 24%, Integrations 16%, Support 9%, Other product lines 13%. Four product lines earn 87% of revenue Revenue by product line in $m · FY26 Source: Illustrative product revenue Platform 38 · 38% Analytics 24 · 24% Integrations 16 · 16% Other product lines 13 · 13% Support 9 · 9%

A pie chart of $100m of revenue shows Platform at 38, Analytics at 24, Integrations at 16 and Support at 9, with the remaining 13 grouped as Other product lines.

Download SVG Fixture IDothers-renamed
JSON spec

This spec includes the theme shown and the options you selected.

{
  "type": "pie",
  "data": {
    "categories": [
      {
        "id": "platform",
        "label": "Platform"
      },
      {
        "id": "analytics",
        "label": "Analytics"
      },
      {
        "id": "integrations",
        "label": "Integrations"
      },
      {
        "id": "support",
        "label": "Support"
      },
      {
        "id": "training",
        "label": "Training"
      },
      {
        "id": "hardware",
        "label": "Hardware"
      },
      {
        "id": "marketplace",
        "label": "Marketplace"
      }
    ],
    "series": [
      {
        "id": "rev",
        "label": "Revenue",
        "values": [
          38,
          24,
          16,
          9,
          6,
          4,
          3
        ]
      }
    ]
  },
  "options": {
    "topN": {
      "n": 4,
      "rest": true
    },
    "strings": {
      "others": "Other product lines"
    },
    "title": "Four product lines earn 87% of revenue",
    "subtitle": {
      "measure": "Revenue by product line",
      "period": "FY26"
    },
    "unit": "$m",
    "source": "Illustrative product revenue"
  }
}

Revenue by channel in a thin ring

doughnut chart, 4 slices of Revenue, total 100. Shares: Direct 42%, Partner 28%, Retail 19%, Other 11%. Direct and partner sales contribute 70% of revenue Revenue by channel in $m · FY26 Source: Illustrative channel revenue 100 $m Direct 42 · 42% Partner 28 · 28% Retail 19 · 19% Other 11 · 11%

A thin doughnut of $100m of revenue shows Direct at 42, Partner at 28, Retail at 19 and Other at 11, so Direct and Partner give 70%.

Download SVG Fixture IDdoughnut-four-channel-revenue
JSON spec

This spec includes the theme shown and the options you selected.

{
  "type": "pie",
  "data": {
    "categories": [
      {
        "id": "direct",
        "label": "Direct"
      },
      {
        "id": "partner",
        "label": "Partner"
      },
      {
        "id": "retail",
        "label": "Retail"
      },
      {
        "id": "other",
        "label": "Other"
      }
    ],
    "series": [
      {
        "id": "revenue",
        "label": "Revenue",
        "values": [
          42,
          28,
          19,
          11
        ]
      }
    ]
  },
  "options": {
    "doughnut": 0.8,
    "title": "Direct and partner sales contribute 70% of revenue",
    "subtitle": {
      "measure": "Revenue by channel",
      "period": "FY26"
    },
    "unit": "$m",
    "source": "Illustrative channel revenue"
  }
}

One channel highlighted in a spend mix

doughnut chart, 3 slices of Spend, total 400. Shares: Search 50%, Social 30%, Display 20%. Social takes 30% of media spend Media spend in $k · FY26 Source: Illustrative media plan 400 $k Social 120 · 30% Search 200 · 50% Display 80 · 20%

A doughnut of $400 thousand of media spend highlights Social at 120 (30%) in dark blue, with Search at 200 (50%) and Display at 80 (20%) in gray.

Download SVG Fixture IDhighlight-channel
JSON spec

This spec includes the theme shown and the options you selected.

Changed from the fixture: options.title.

{
  "type": "pie",
  "data": {
    "categories": [
      {
        "id": "search",
        "label": "Search"
      },
      {
        "id": "social",
        "label": "Social"
      },
      {
        "id": "display",
        "label": "Display"
      }
    ],
    "series": [
      {
        "id": "spend",
        "label": "Spend",
        "values": [
          200,
          120,
          80
        ]
      }
    ]
  },
  "options": {
    "doughnut": 0.6,
    "highlight": [
      "social"
    ],
    "strings": {
      "notApplicable": "Not applicable"
    },
    "title": "Social takes 30% of media spend",
    "subtitle": {
      "measure": "Media spend",
      "period": "FY26"
    },
    "unit": "$k",
    "source": "Illustrative media plan"
  }
}

Minimal spec

Save this spec as pie.json and run the command.

{
  "type": "pie",
  "data": {
    "categories": [{ "id": "renewals", "label": "Renewals" }, { "id": "new", "label": "New" }],
    "series": [{ "id": "revenue", "label": "Revenue", "values": [70, 30] }]
  },
  "options": { "unit": "$k", "title": "Renewals contribute 70% of revenue", "source": "Illustrative data" }
}
npx boardplot render pie.json --out pie.svg