Skip to content

Animation ​

On or off ​

ts
createChart(host, spec);                            // animated
createChart(host, spec, { animation: false });      // drawn at once

People who ask their system for less motion get no animation, whatever you write.

When ​

ts
createChart(host, spec, { animation: { start: 'load' } });     // at once, the default
createChart(host, spec, { animation: { start: 'visible' } });  // when the reader scrolls to it
const chart = createChart(host, spec, { animation: { start: 'manual' } });
button.onclick = () => chart.play();                           // when you decide, as often as you want

The room of the chart is kept while it waits, so nothing on the page jumps.

How ​

OptionDoes
speed2 is twice as fast
durationmilliseconds for each mark, instead of the timing of the chart
delaymilliseconds before the first mark
staggerfalse moves every mark together
easingany CSS easing, such as cubic-bezier(.34,1.56,.64,1) for a bounce
effectfade replaces movement by a fade

Charts use the Web Animations API of the browser: no timer runs once they are drawn. Only liquid and pipeline with flow move without end.

chart.update(spec) plays again; chart.refresh(spec) does not, for live data.