Pie charts: titles and data labels
简介 / Introduction
Pie charts visualize proportions of parts against a whole and are a staple of data visualization. This article compares PlantUML and Mermaid syntax for drawing pie charts with titles and data labels.
PlantUML version
1 | @startuml |
PlantUML uses title, a legend block, and multiple skinparam directives to control the title and labels. Data labels are embedded inside the legend rather than rendered directly on the chart.
Mermaid version
1 | pie title Software Project Duration Distribution |
Mermaid’s syntax is minimal: pie + title + a list of key-value pairs. The title sits directly after the pie keyword with no extra skinparam needed.
对比 / Side-by-side
| Feature | PlantUML | Mermaid |
|---|---|---|
| Title syntax | title xxx |
pie title xxx |
| Data labels | legend embedded text | key : number pairs |
| Color control | skinparam pieElementFontColor |
quoted labels |
| External legend | legend right / left |
requires CSS override |
| Syntax complexity | high (many skinparams) | low (title line + data) |
小结 / Wrap-up
PlantUML pie charts offer fine-grained control over fonts, colors, and legend placement — ideal when you need precise styling. Mermaid wins on brevity: one title line plus key-value pairs produces a clean chart immediately. Choose based on your team’s styling needs and chart complexity.
- Title: Pie charts: titles and data labels
- Author: puml.online
- Created at : 2026-09-19 09:00:00
- Updated at : 2026-09-29 01:06:38
- Link: https://puml.online/blog/pie-chart-titles-en/
- License: This work is licensed under CC BY-NC-SA 4.0.