Each row is a slice. The slices start at the top and go clockwise, in the order of the table.
| Picked | 68.7 |
|---|---|
| Juiced | 38.2 |
| Eaten fresh | 18.1 |
| Sold whole | 12.4 |
<figure class="tablechart" data-chart="donut">
<figcaption>
<b>Where the crop went</b><br>
<span>thousands of apples</span>
</figcaption>
<table>
<tbody>
<tr data-kind="total"><th>Picked</th><td>68.7</td></tr>
<tr><th>Juiced</th><td>38.2</td></tr>
<tr><th>Eaten fresh</th><td>18.1</td></tr>
<tr><th>Sold whole</th><td>12.4</td></tr>
</tbody>
</table>
</figure>
If a row has data-kind="total", its value is shown in the middle. If there is no total row, the middle shows the sum of the slices.
| Picked | 74.5 |
|---|---|
| Juiced | 38.2 |
| Eaten fresh | 18.1 |
| Sold whole | 12.4 |
| Composted | 5.8 |
By default, all slices use the text colour, each one a bit lighter. To set your own colours, set --tablechart-color-1, -2 and on.
| Picked | 68.7 |
|---|---|
| Juiced | 38.2 |
| Eaten fresh | 18.1 |
| Sold whole | 12.4 |
.donutpalette {
--tablechart-color-1: #b4552d;
--tablechart-color-2: #d69a52;
--tablechart-color-3: #7fa87f;
}
If a chart has --tablechart-corner-radius, the corners of its slices are rounded. A thin slice gets a smaller radius.
| Picked | 68.7 |
|---|---|
| Juiced | 38.2 |
| Eaten fresh | 18.1 |
| Sold whole | 12.4 |
<figure class="tablechart" data-chart="donut" style="--tablechart-corner-radius: 6px;">
<figcaption>
<b>Where the crop went</b><br>
<span>thousands of apples</span>
</figcaption>
<table>
<tbody>
<tr data-kind="total"><th>Picked</th><td>68.7</td></tr>
<tr><th>Juiced</th><td>38.2</td></tr>
<tr><th>Eaten fresh</th><td>18.1</td></tr>
<tr><th>Sold whole</th><td>12.4</td></tr>
</tbody>
</table>
</figure>
Add data-fragment to the figure to show one slice per step.
| Picked | 68.7 |
|---|---|
| Juiced | 38.2 |
| Eaten fresh | 18.1 |
| Sold whole | 12.4 |
<figure class="tablechart" data-chart="donut" data-fragment>
<figcaption>
<b>Where the crop went</b><br>
<span>thousands of apples</span>
</figcaption>
<table>
<tbody>
<tr data-kind="total"><th>Picked</th><td>68.7</td></tr>
<tr><th>Juiced</th><td>38.2</td></tr>
<tr><th>Eaten fresh</th><td>18.1</td></tr>
<tr><th>Sold whole</th><td>12.4</td></tr>
</tbody>
</table>
</figure>