Chart
Bar, column, line, pie and donut charts from a list of numbers.
yuhwa
chart latency "Latency p95" [unit: ms] {
checkout: 120
search [green]: 48
login: 80
}Syntax
Each line is label [color]: number.
| prop | values |
|---|---|
type | bar (default), column, line, pie, donut |
unit | appended to every value, e.g. ms or % |
Bars, columns and lines use the theme accent unless a line sets a colour. Pie and donut slices cycle through the palette. For small charts inside a node, use the card rows bars, spark and progress instead.
A chart has one handle, size, at its bottom-right corner. stats:size 80 40 makes the plot 80 wider and 40 taller.
Every type
yuhwa
panels: grid
chart bar "bar" [type: bar] {
EU: 46
US: 31
APAC: 23
}
chart column "column" [type: column] {
Mon: 4
Tue: 7
Wed: 3
Thu: 9
Fri: 2
}
chart line "line" [type: line] {
Jan: 120
Feb: 180
Mar: 160
Apr: 260
}
chart pie "pie" [type: pie, unit: %] {
Chrome: 64
Safari: 19
Firefox: 9
Other: 8
}
chart donut "donut" [type: donut, unit: %] {
TypeScript: 64
Rust: 21
CSS: 15
}Examples
Colours per item
yuhwa
chart budget "Cloud spend" [type: column, unit: k€] {
compute: 42
storage [teal]: 18
network: 9
"data transfer" [red]: 27
}Numbers next to the system
yuhwa
title: Search
direction: right
web "Web" [blue] -> search "Search API" [blue] -> idx "Index" [cylinder, amber]
chart qps "Queries per second" [type: line] {
Mon: 820
Tue: 940
Wed: 1100
Thu: 1040
Fri: 1310
}A dark dashboard
yuhwa
theme: midnight
panels: row
chart uptime "Uptime" [type: donut, unit: %] {
up [green]: 99.9
down [red]: 0.1
}
chart errors "Errors by service" {
api [red]: 14
jobs [amber]: 6
web: 2
}