On the hello-world example, replace the scene.addAnimations with:
scene.addAnimations([{ selector:'#chart', // JQuery selector pointing to the HtmlElement tasks: [{ handler:'chart', // is always 'chart' for charts. params: { chartType:BeamToIX.ChartTypes.bar, // or 'bar' if you are using javascript labelsX: { captions: ['A', 'B', 'C', 'D', 'E'] }, title:'My first Chart', data: [[100, 200, 50, 140, 300]], } asBeamToIX.AxisChartTaskParams, // comment as ... if you are using javascript }], }]);
The previous example, will create a static chart.
To animate it, change it the to following:
scene.addAnimations([{ selector:'canvas', tasks: [{ handler:'chart', params: { chartType:BeamToIX.ChartTypes.bar, labelsX: { captions: ['A', 'B', 'C', 'D', 'E'] }, title:'My first Chart', data: [[100, 200, 50, 140, 300]], // animation parameters pointHeightStart:0.1, // defined the initial value for the animation point-height property animeSelector:'chart-anime-01', // unique animation selector to be used by the animator } asBeamToIX.AxisChartTaskParams, }], }]) .addAnimations([{ selector:`%chart-anime-01`, // animation selector defined previously, prefixed with '%' duration:`1s`, props: [{ prop:'point-height', // property which initial value is 0.1 value:1, // value at the end of animation }], }]);
Description
A chart task creates an animated chart.
WARN This plugin is still in development stage, parts of API can change in the future. However is already in a stage that can be used.
This plugin has the following built-in charts:
read the details on .
Get started
How to create a simple bar chart:
The bare-bones of a
beamtoix.scssfile:The bare-bones of a
htmlfile:On the
hello-worldexample, replace thescene.addAnimationswith:The previous example, will create a static chart. To animate it, change it the to following: