Pie charts: titles and data labels

Pie charts: titles and data labels

puml.online

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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@startuml
title Software Project Duration Distribution

skinparam titleFontSize 14
skinparam legendFontSize 12

skinparam pieTitleFontSize 16
skinparam pieTitleFontColor blue

skinparam pieVerticalLabelPosition 2
skinparam pieElementFontSize 11
skinparam pieElementFontColor black
skinparam pieBorderThickness 1

legend right
<color:blue>**Duration Distribution**</color>
Development 45%
Testing 25%
Deployment 15%
Documentation 15%
endlegend
@enduml

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
2
3
4
5
pie title Software Project Duration Distribution
"Development" : 45
"Testing" : 25
"Deployment" : 15
"Documentation" : 15

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-12-06 10:29:22
  • Link: https://puml.online/en/blog/pie-chart-titles/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Pie charts: titles and data labels