Animated Bars – Callbacks

This is an example of a chart created using animated-bars. When you animate a chart with a generator you can optionally pass a callback, which will be called at the start of each transition. This allows you to update other aspects of the UI in lock-step with changes to the values in the chart. To help you control the visual effect of these updates, you can set the timing of the callback relative to the start of the transition.

Population of the UK by single year of age, 1971-2018

The chart shows the number of people of each single year of age in each year. A callback is used to update the year label in the bottom left of the chart as it animates through the age-distributions.

Find out more about this chart.