GitHub

Options reference

Options go above the --- line, one per line, written key: value. Only type is required. Keys are lower case, and values can be wrapped in quotes.

All options

OptionValuesDefaultWhat it does
typebar line area pie doughnut scatter radarrequiredThe chart type.
titleany textnoneText above the chart.
x-labelany textnoneTitle for the label axis.
y-labelany textnoneTitle for the value axis.
legendtop bottom nonetop, or none for one seriesWhere the list of series or slices goes.
height120 to 1200300, or your settingChart height in pixels. The width always fills the note.
stackedtrue falsefalseStack the series on top of each other.
horizontaltrue falsefalseDraw bars left to right.
colorshex colours, comma separatednoneColours for this chart only. Overrides palette. See Colours and palettes.
palettea palette nameyour default paletteUse a palette from settings.
sourcea tag such as "#daily", or a folder pathnoneDraw from note properties instead of a table.
xa property namenoneWith source: the property along the x axis.
yproperty names, comma separatednoneWith source: the properties to plot.

yes and no also work for true and false. A height outside 120 to 1200 is ignored with a warning.

Which options work on which type

Options that don't apply to a type are ignored without a warning, so you can switch type freely.

OptionBarLineAreaPieDoughnutScatterRadar
title, legend, heightYesYesYesYesYesYesYes
colors, paletteYesYesYesYesYesYesYes
x-label, y-labelYesYesYesNoNoYesNo
stackedYesYesYesNoNoNoNo
horizontalYesNoNoNoNoNoNo
source, x, yYesYesYesYesYesYesYes

Misspelt options

An option the plugin doesn't know shows a warning under the chart, and the chart still draws. If the key is close to a real one, the warning suggests it:

The chart this block draws
```s-chart
type: bar
title: Monthly revenue
pallet: brand
---
| Month | Revenue | Costs |
| ----- | ------- | ----- |
| Jan   | 4200    | 3100  |
| Feb   | 5100    | 3300  |
| Mar   | 6300    | 3500  |
| Apr   | 5800    | 3400  |
```

Line 3: unknown key "pallet", did you mean palette?