Bar, line, area, pie and doughnut charts from a few lines of text, or from a grid you can paste a spreadsheet into
A chart shows numbers as a picture: bars to compare things, a line for a trend, a pie for the parts of a whole. In Kribble a chart is a few lines of text. You can write the text yourself, let an AI agent write it, or fill in a grid and let Kribble write it. Either way the note keeps the text, so the same chart shows in the editor, on published sites, in PDFs and in the IDE extensions.
Type /chart in a note. A small example chart appears with its editing panel open:
The kind: Bar, Line, Area, Pie or Doughnut, and for bars and areas Stacked, for bars Horizontal.
Title, X axis, Y axis and Unit. The unit is written with every value: $ and € go before the number ($120), % right after it, anything else after a space (42 min).
The data, as a grid: a row per label (a quarter, a team, a country), a column per series (2024, 2025…). + Row and + Series add one; the × at the end of a row or next to a series name removes it. Enter moves down a row, and adds one at the end.
Colours. The square next to a series name picks its colour: click it to step through them. Pies and single-series bar charts have one per row, to pick out a slice or a bar.
Text shows the chart's text instead of the grid. Change either; the other follows.
Paste from a spreadsheet. Copy cells in Excel, Numbers or Google Sheets and paste them into the grid's first cell: the rows and columns fill in. If the copied cells start with a header row, its names become the series.
Click Done, or press Escape, when you're finished. To change a chart later, hover it and click Edit, or double-click it. Hovering a bar, a point or a slice shows its values.
In markdown, a chart is a fenced code block with the chart language, so the text above is all there is to it. Markdown viewers that don't know Kribble's charts, like GitHub, show the text, which still reads well.
Write | For |
|---|---|
| comparing things side by side; one group of bars per row |
| totals made of parts: one bar per row, its segments the series |
| rankings, and labels too long to fit under a bar |
| change over time |
| change over time, where the amount (or how it adds up) matters |
| the parts of a whole: a slice per row |
donut, and plurals like bars, work too.
Lines starting with one of these words and a colon set something about the chart. They can go anywhere after the first line, usually at the top.
Setting | |
|---|---|
| The title above the chart. |
| The title of the axis along the rows. |
| The title of the value axis. |
| Written with every value. |
| Where the value axis starts and ends. Bars and areas always start at zero. |
| Names for the columns of values, in order. Leave it out when there's only one. |
Every other line is a row: a label, a colon and the values, separated by commas.
Q1: 120, 135
Q2: 140, 151
Numbers are written plainly: 1200, -3.5, 0.25. A $ (or €, £, ¥, ₹) before a number or a % after it is fine, and becomes the unit when there's none. 1,200 or 1.2k aren't numbers.
Missing values are left empty: Q3: 120, , 140, or Thu: for a row with none. A bar is left out, and a line has a gap.
Labels can have spaces. A label with a comma, a colon or a bracket goes in double quotes: "Sales, EMEA": 40. So does a label that's one of the settings' words: "title": 3.
Colours go in square brackets after a series name or a label: series: Plan [gray], Actual [blue], or Q4 [green]: 171 to pick out one bar or slice. The colours are blue, orange, teal, yellow, pink, green, purple, red and gray, or any #rrggbb. Without them, series get blue, orange, teal, yellow and so on, in an order chosen to stay apart for colour-blind readers.
A # followed by a space starts a comment.
A pie draws the first value of each row. More than 8 slices are too many to tell apart: the 7 largest stay and the rest become one gray "Other" slice. A chart draws at most 8 series.
A line Kribble can't read doesn't break the chart: the rest still draws, and the editor lists what's wrong under the chart, with the line. A misspelt word gets a suggestion: unknown colour "gren" (did you mean "green"?). kribble check reports the same in a markdown file, and agents get them as warnings when they write.
A stacked bar chart:
A ranking with long labels:
A doughnut, its total in the middle:
A line with a gap, and an axis that doesn't start at zero:
The full language, for anyone building on it, is in spec/chart-language.md in Kribble's repository.