Skip to content

Pie Chart Component

Data
type: "pie"

Pie and donut charts from a single data series, with slice labels, percentages and a legend — proportions at a glance.

Edit it — this is the actual editor panel
Design JSON
{
  "title": "Pie chart sample",
  "description": "A dynamic pie chart",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-pie",
      "key": "share",
      "type": "pie",
      "position": {
        "x": 250,
        "y": 60
      },
      "rotation": 0,
      "size": {
        "width": 300,
        "height": 300
      },
      "dynamic": true,
      "properties": {
        "variant": "pie",
        "data": [
          40,
          30,
          20,
          10
        ],
        "labels": [
          "North",
          "South",
          "East",
          "West"
        ],
        "colors": [],
        "showValues": true,
        "labelType": "percent",
        "showLegend": true,
        "legendPosition": "bottom",
        "opacity": 1
      }
    }
  ]
}

Like what you built? The full editor — canvas, templates and the render API — is free to start.

Open the editor

Pie chart examples

Real renders of the pie chart — each one is the same component with different property values, and the API payload below each preview reproduces it exactly.

Traffic sources breakdown

Visitor share by acquisition channel, percent-labeled per slice.

API overrides for this example
{
  "share.data": [
    46,
    27,
    17,
    10
  ],
  "share.labels": [
    "Organic",
    "Direct",
    "Social",
    "Referral"
  ],
  "share.colors": [
    "#6366F1",
    "#0EA5E9",
    "#F59E0B",
    "#94A3B8"
  ]
}

Monthly budget split

A household budget by category with raw dollar amounts on the slices.

API overrides for this example
{
  "share.data": [
    1200,
    650,
    400,
    350
  ],
  "share.labels": [
    "Rent",
    "Food",
    "Transport",
    "Other"
  ],
  "share.colors": [
    "#10B981",
    "#F59E0B",
    "#6366F1",
    "#94A3B8"
  ],
  "share.labelType": "value"
}

All pie chart styles

Every style rendered live — each is just a different set of property values on the same component, and each has its own page with a dedicated preview, use cases and API example.

Use cases

What developers typically build with the pie chart component.

  • Market or traffic share visuals in automated reports
  • Budget and spend breakdown images for finance emails
  • Poll and survey result cards for social media
  • Portfolio allocation snapshots

Use it dynamically via the API

Update slice values with '<key>.data' and names with '<key>.labels'; variant and colors are overridable too.

Full API request with the sample design's current values — the playground above sends only the properties you change
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "share.variant": "pie",
    "share.data": [
        40,
        30,
        20,
        10
    ],
    "share.labels": [
        "North",
        "South",
        "East",
        "West"
    ],
    "share.colors": [],
    "share.showValues": true,
    "share.labelType": "percent",
    "share.showLegend": true,
    "share.legendPosition": "bottom",
    "share.opacity": 1
}'

Only send the properties you want to change — everything else keeps its design value. See the API documentation for all languages.

Property reference

Every property the pie chart component accepts — in the editor, in design JSON, and as API overrides.

PropertyTypeEdits asDefaultDescription
variant'pie' | 'donut'piedonut"pie"Full pie or donut with a hole.
datanumber[]text[]Slice values.
labelsstring[]text[]Slice names.
colorscolor[]text[]Slice color palette (falls back to built-in palette).
innerRadiusnumber0.60.6Donut hole radius as a fraction of the pie radius.
showValuesbooleantruetruePrint a label on each slice.
labelType'percent' | 'value'percentvalue"percent"Whether slice labels show percentages or raw values.
showLegendbooleantruetrueShow the slice legend.
legendPosition'top' | 'right' | 'bottom'toprightbottom"bottom"Where the legend is placed.
textColorcolor#52514e"#52514e"Color of labels and legend text.
opacitynumber11Overall component opacity from 0 (transparent) to 1 (opaque).
borderWidthnumber00Border thickness in pixels around the component.
borderColorcolortransparent"transparent"Border color (any CSS color).
borderStyle'solid' | 'dashed' | 'dotted' | 'double' | 'none'soliddasheddotteddoublenone"solid"Border line style.
borderRadiusnumber00Corner radius in pixels.
boxShadowstringtext—CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)".

Frequently asked questions

Yes — '<key>.data' sets the slice values and '<key>.labels' the names; colors and the pie/donut variant are overridable too.

Set variant to 'donut' and tune innerRadius (a fraction of the pie radius) to size the hole — leaving room for a centered metric.

Yes — labelType switches slice labels between 'percent' and 'value', and showValues toggles the labels entirely.

Pass a colors array to map your palette onto the slices in order; omit it to fall back to the built-in palette.

We use cookies to run the site and, depending on your region and your choice here, for analytics and marketing. See our Cookie Policy. You can change this any time from “Cookie settings” in the footer.