Pie charts in Confluence

A pie chart shows how one total splits into a few shares.

Last updated

When to use it

Use a pie chart for a simple share of a whole with a handful of slices: budget by department, bugs by area. With more than about six slices, or when values are close to each other, a bar chart (an XY chart) is easier to read.

Example

This is the code of the Budget split template: share of the annual budget by department.

pie showData
  title Annual budget
  "Engineering" : 45
  "Sales and marketing" : 25
  "Operations" : 15
  "Support" : 10
  "Other" : 5

Vellnar Diagrams draws it like this:

Change a line and the diagram changes with it. Nobody needs the original drawing file, because there is none: the code is the diagram.

Add it to a Confluence page

  1. Edit a Confluence page and type /mermaid where the diagram should go.
  2. Select Mermaid diagram. The editor opens with the template list.
  3. Pick a template, or choose Start blank and paste the code above. The preview follows every keystroke.
  4. Choose Save. The diagram appears on the page.

The documentation covers the editor, the settings and the exports.

Templates

The Templates button in the editor has 2 pie charts ready to use:

  • Budget split: Share of the annual budget by department.
  • Bug categories: Bugs of the last quarter by area.

Syntax

The code of a pie chart starts with pie. The Mermaid documentation describes every element of the syntax. Vellnar Diagrams draws it with Mermaid 12.3; if a line has an error, the editor marks the line and keeps the last valid diagram on screen.

More

  • Mermaid in Confluence: how diagrams as code work in a page, and every diagram type.
  • Security: the app asks for no permissions and sends nothing outside Atlassian.