Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jcardama opened this issue Jan 26, 2021 · 2 comments
Open

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

jcardama opened this issue Jan 26, 2021 · 2 comments

Comments

@jcardama
Copy link

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?

@tehras
Copy link
Owner

tehras commented Jan 26, 2021

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 :(

@yashovardhan99
Copy link
Contributor

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants