Graph Animation

In Home Automation module, project 5 there is a task given to animate the linegraph. I was unable to find the answer/code. Anyone please help me or just tell me where to find if it is in bolt cloud docs.

1 Like

Please check the following link for the setAnimation function

1 Like

check the code twice ,maybe any semicolon is missing also notice that some alphabets are case sensitive

*Write down the following code to implement the same:

plotChart('time_stamp','light');  /*light is the variable name*/

Since it is a line graph that is why you won’t be able to see the effect of ‘animation’ clearly. To see the effect use a bar graph or any other graph for the same.

1 Like

Can you tell please, exactly what happens in animation in bargraph?

This function describes how to animate modifications made to a chart, instead of applying them instantly. setAnimation() function supports the following options as parameter- true, false. It is enabled (true) by default and this function should be called before the plotChart() function.

@kamlanita01 in a bar graph, when setAnimation is set to true, as and when a new data point is recorded in the graph, the bar rises up as though the top is “racing” to its y-axis value. You can see the effect in by editing the code in the link below: