Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pie charts

sirene draws Mermaid pie charts (pie) as images and as text:

pie title Pets adopted by volunteers
    "Dogs" : 386
    "Cats" : 85
    "Rats" : 15
the drawing of the mermaid source above

In the editor a pie chart is read-only on the drawing side.

What is read

SyntaxDrawn as
pieslices largest first, clockwise from the top, with a legend to the right
pie showDataeach value in the legend (Dogs [386]) and in the text form
title textthe title above, also on the header line (pie title Pets); frontmatter title too
"label" : 42.5a slice; single quotes work too

Each slice shows its share as a whole percent. As in Mermaid, a slice under 1% is not drawn (the others fill the circle) but stays in the legend.

Errors

A negative value is an error, and a label given twice is a warning; the slice is skipped and the rest of the chart is drawn.

Colors

Slice colors can be overridden with themeVariables.pie1 to pie12; see Themes.

Not drawn

textPosition is ignored.