Sales dashboard: KPIs and four charts on one page
A one-page A4 landscape dashboard (Finnish locale): four KPI boxes and a 2 × 2 grid of charts, all from one data file.
liuska render -t examples/sales-dashboard/template.json -d examples/sales-dashboard/data.json -o dashboard.pdf
Things to look at:
- Line chart
regionTrenduses"seriesFrom": "dashboard.regionSeries": the data decides which regions get a line (key, label, color, format per series). Add a region toregionSeriesand the monthly rows, and the chart gets another line with no template change.smooth: truedraws monotone curves. - Null handling: Lappi opened in April, so its January–March values are
null. Its line starts in April instead of dropping to zero. - Both monthly charts get ISO dates (
"month": "2026-01-01") and name them withcategory.format: "date:\"Jan\"", localized totammi,helmi, … byfi-FI. - Stacked bar chart
channelMix("stacked": true) reads the samedashboard.monthlyrows as the line chart but plots the channel keys (stores,b2b,online) with fixedseries. Each month's stack equals the sum of the regions in that month. - Donut
categoryMixwith"dataLabels": "percent"(each slice shows its share), a custompaletteand the legend on the right. - Horizontal bar chart
topProducts("horizontal": true), sorted in the data. - Number formatting comes from the
fi-FIlocale: ticks such as300 000, KPIs such as7 343 979,00 €and33,4 %. - KPI change lines take their sign from the data:
{{dashboard.kpi.revenueGrowthSign}}{{dashboard.kpi.revenueGrowth | percent:1}}, where the backend sends"+"for an increase and""for a decrease (thepercentfilter prints the minus itself). The text color is neutral, so a decrease doesn't show up in green. - The
cardstyle gives every chart its white box, border, radius and padding, and sets the chart text to 7 pt. - Layout arithmetic: page 842 × 595 pt, 24 pt margins, a 40 pt header (body starts at y 64), KPI row at y 72–128, chart rows at y 140–340 and 352–552, footer band from y 555. Columns are 390 pt wide with a 14 pt gutter (x 24 and 428).