tehras/charts

Bar chart animation starts from 0 when bar.value is updated

Opened this issue · 2 comments

I have a bar chart with a bar set with bar.value = 100. Then when I update this value to 150 the following happens:

From 100 it jumps to 0 and then animates back to 150.

I'm looking for a way so that instead of jumping to 0 and then animating to 150 it animates from 100 to the next new value which in this case is 150.

Is there a way to do this?

Not with the way I did it here :(.
You can probably save the previous BarChartData and pass that into BarChartData.forEachWithArea and then do the calculation based off of that.
It's a cool idea though, animating chart diffs, I didn't really think of those use cases :(

@tehras I tried a similar animation with a custom line chart library I was making.
I can try implementing something here.
Will using the barChartData.maxYValue be fine for that?