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.
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
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Pie Chart”, insert it. Category: Charts.
- Configure inspector controls that exist on this block. Open Chart Data. Set “Label”, “Value”, “Show Title”, “Title & Labels — Title”.
- Publish. Save the page. Output is the saved block HTML; typography/colors follow Blockenberg shared panels.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Label | Text field in the inspector. |
| Value | Numeric range control in the inspector. Range 1–10000. |
| Show Title | On/off toggle in the inspector. On by default. Saved as `showTitle`. |
| Title & Labels — Title | Text field in the inspector. block.json default: Revenue by Channel. Saved as `title`. |
| Show Subtitle | On/off toggle in the inspector. On by default. Saved as `showSubtitle`. |
| Subtitle | Text field in the inspector. block.json default: Q1 2025 breakdown. Saved as `subtitle`. |
| Title Align | Select control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `titleAlign`. |
| Show % Labels on Slices | On/off toggle in the inspector. On by default. Saved as `showLabels`. |
| Show Legend | On/off toggle in the inspector. On by default. Saved as `showLegend`. |
| Legend Position | Select 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 Width | Numeric range control in the inspector. Range 0–8. block.json default: 2. Saved as `strokeWidth`. |
| Layout | Select 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 — Background | Color control in the inspector. block.json default: #ffffff. Saved as `bgColor`. |
| Colors — Title | Color control in the inspector. block.json default: #0f172a. Saved as `titleColor`. |
| Subtitle | Color control in the inspector. block.json default: #64748b. Saved as `subtitleColor`. |
| Legend Text | Color control in the inspector. block.json default: #374151. Saved as `legendColor`. |
| Slice Stroke | Color control in the inspector. block.json default: #ffffff. Saved as `strokeColor`. |
When this is the right block
- 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 — that is the job of Pie Chart, not a generic content block.
- Use it when you need the editor control labeled “Label”, which exists on this block’s inspector.
- It matches pages about pie chart, chart, graph.
- Inserter grouping: reports, dashboards, and data-heavy pages.
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
Area Chart
Smooth filled area chart with multiple datasets, gradient fills, and animation using Chart.js (CDN). Great for showing trends over time.
Bar Chart
Vertical or horizontal bar chart with multiple datasets using Chart.js (CDN). Supports stacked, border radius, and custom colors.
Doughnut Chart
Pie/doughnut chart with adjustable cutout, center label, and per-slice colors using Chart.js (CDN).
Line Chart
Interactive line chart using Chart.js (loaded from CDN). Supports multiple datasets, fill, tension, and grid styling.
Bubble Chart
Interactive bubble chart powered by Chart.js.
Dumbbell Chart
Horizontal dumbbell (connected dot) chart comparing two values per category — ideal for before/after, target vs actual, or two-group comparisons.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Pie Chart from the Gutenberg inserter.