Your first chart
The quickest way in is the Insert chart command. It puts a working sample block at the cursor, which you then edit.
Insert a sample
- Open a note and place the cursor on an empty line.
- Open the command palette (Ctrl or Cmd + P) and run S-Charts: Insert chart.
- Move the cursor out of the block. The chart draws.
The command has no hotkey by default. You can add one in Settings → Hotkeys.
Parts of a block
```s-chart
type: bar
title: Monthly revenue
---
| Month | Revenue | Costs |
| ----- | ------- | ----- |
| Jan | 4200 | 3100 |
| Feb | 5100 | 3300 |
| Mar | 6300 | 3500 |
| Apr | 5800 | 3400 |
``````s-chartopens the block. The language must bes-chart.- Each line above
---is an option, writtenkey: value. Onlytypeis required. All options are in the options reference. - The
---line separates options from data. - The table is the data. The first column holds the labels and every other column is one series. See Writing the table.
Change the chart
Change type: bar to type: line and move the cursor out of the block: the same table now draws as a line chart. Every chart type reads the same table, so you can try each one without retyping anything.
Edit a chart later
In live preview, hover over a chart and select the </> button in its top-right corner. The block opens as text. You can also move into it with the arrow keys.
Reading view shows the chart but has no edit button. Switch to live preview or source mode to edit.