Tablechart

for Reveal.js: Adding annotations

Bracket

A bracket shows the change between two bars. If the chart has only two bars, no attributes are needed.

<div class="chart-annotations">
  <span data-annotation="bracket">+11%</span>
</div>
Apple juice
thousands of litres
Last season 251.5
This season 279.6
+11%
Orange juice
thousands of litres
Last season 92.2
This season 76.1
-17%
Lemon juice
thousands of litres
Last season 248.2
This season 261.6
+5%

Choose the bars

If the chart has more bars, set data-from and data-to to the row numbers. The first row is 1.

Apples per tree
each
2021 74
2022 80
2023 91
2024 102
2025 116
+45%
<span data-annotation="bracket" data-from="2" data-to="5">
  +45%
</span>

Trend

A trend arrow runs from the first value to the last.

Apples per tree
each
2021 74
2022 80
2023 91
2024 102
2025 116
A year+12%
<span data-annotation="trend" data-years="4" data-at="0.46">
  <span class="tablechart-caption">A year</span>
  <span>+12%</span>
</span>

Check the rate

Set data-years to the number of years. Tablechart calculates the rate, and shows a warning in the console if it is different from yours. Your number is always the one shown.

A rate that does not add up
each
2021 74
2022 80
2023 91
2024 102
2025 116
A year+40%

Open the console on this slide.