Charts · Gutenberg

Pie Chart block for WordPress

SVG-based pie chart with labelled wedge segments, percentage display, and an optional legend. Renders inline without external libraries — no doughnut/ring, true pie slices with mid-wedge labels and hover tooltips.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

SVG-based pie chart with labelled wedge segments, percentage display, and an optional legend. Renders inline without external libraries — no doughnut/ring, true pie slices with mid-wedge labels and hover tooltips.

Inspector panels on this block: Chart Data, Title & Labels, Chart Dimensions, Spacing & Style. Those titles come from index.js, not from a shared template.

Behavior controls: “Title Align” options: Left, Center, Right; “Legend Position” options: Right, Bottom, Left, Top; “Layout” options: Side (chart + legend), Stacked (chart on top).

Pie Chart has no render.php and no frontend.js. The saved Gutenberg HTML is what visitors see, plus Blockenberg layout/typography CSS.

Where to find it

Gutenberg inserter → Charts → search “Pie Chart” (block name `blockenberg/pie-chart` in block.json). Style it in the sidebar after insert.

How to use Pie Chart block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Pie Chart”, insert it. Category: Charts.
  3. Configure inspector controls that exist on this block. Open Chart Data. Set “Label”, “Value”, “Show Title”, “Title & Labels — Title”.
  4. Publish. Save the page. Output is the saved block HTML; typography/colors follow Blockenberg shared panels.

Inspector controls from this block’s code

ControlWhat the code does
LabelText field in the inspector.
ValueNumeric range control in the inspector. Range 1–10000.
Show TitleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
Title & Labels — TitleText field in the inspector. block.json default: Revenue by Channel. Saved as `title`.
Show SubtitleOn/off toggle in the inspector. On by default. Saved as `showSubtitle`.
SubtitleText field in the inspector. block.json default: Q1 2025 breakdown. Saved as `subtitle`.
Title AlignSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `titleAlign`.
Show % Labels on SlicesOn/off toggle in the inspector. On by default. Saved as `showLabels`.
Show LegendOn/off toggle in the inspector. On by default. Saved as `showLegend`.
Legend PositionSelect control; the chosen value is saved on the block. Options: Right; Bottom; Left; Top. block.json default: right. Saved as `legendPosition`.
Chart Diameter (px)Numeric range control in the inspector. Range 140–500. block.json default: 280. Saved as `size`.
Stroke WidthNumeric range control in the inspector. Range 0–8. block.json default: 2. Saved as `strokeWidth`.
LayoutSelect control; the chosen value is saved on the block. Options: Side (chart + legend); Stacked (chart on top). block.json default: side. Saved as `layout`.
Border Radius (px)Numeric range control in the inspector. Range 0–32. block.json default: 16. Saved as `borderRadius`.
Padding Top (px)Numeric range control in the inspector. Range 0–160. block.json default: 48. Saved as `paddingTop`.
Padding Bottom (px)Numeric range control in the inspector. Range 0–160. block.json default: 48. Saved as `paddingBottom`.
Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Colors — TitleColor control in the inspector. block.json default: #0f172a. Saved as `titleColor`.
SubtitleColor control in the inspector. block.json default: #64748b. Saved as `subtitleColor`.
Legend TextColor control in the inspector. block.json default: #374151. Saved as `legendColor`.
Slice StrokeColor control in the inspector. block.json default: #ffffff. Saved as `strokeColor`.

When this is the right block

Notes from the implementation

Static block: markup is saved in post content; no PHP render callback in this folder.

FAQ

How do I add the Pie Chart block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Pie Chart”. It sits under Charts. After insert, open Chart Data and set “Label”, “Value”, “Show Title”, “Title & Labels — Title”.

What makes Pie Chart different from other Blockenberg blocks?

SVG-based pie chart with labelled wedge segments, percentage display, and an optional legend. Renders inline without external libraries — no doughnut/ring, true pie slices with mid-wedge labels and hover tooltips. Inspector labels on this block include “Label”, “Value”, “Show Title”, “Title & Labels — Title”.

Is the Pie Chart Gutenberg block free?

Yes. Pie Chart ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Pie Chart to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Chart Data, Title & Labels, Chart Dimensions, Spacing & Style).

Related charts blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Pie Chart from the Gutenberg inserter.

Get Blockenberg