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

Loading data corrupts chart if previous transition is not finished #337

Open
lblb opened this issue Jun 9, 2014 · 3 comments
Open

Loading data corrupts chart if previous transition is not finished #337

lblb opened this issue Jun 9, 2014 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@lblb
Copy link

lblb commented Jun 9, 2014

Hi,
I noticed nasty behavior if you quickly load new data without waiting for the end transition.
I have a couple of radio buttons in my project, that change the scope of chart, hence user can hit them quickly. It corrupts chart object meaning that any further loading of data does not correct it, but makes even worse. This is especially evident with grouped bar charts, please take a look at fiddle:
http:https://jsfiddle.net/e7ZbT/
Simple bar chart may get to inconsistent state if new data is loaded too quickly, but usually next load fix it, so it's not so critical. In contrast grouped charts cannot be corrected, unless refresh of the page.
Any suggestions are very welcome.

@masayuki0812
Copy link
Member

Hi, I agree to fix this issue. I think this solution might work:

  • Detect duplicated transition
  • If detected, call flush to cancel the transition and draw as transition ends
  • Start transition

This needs to be implemented within c3, but this solution might be able to be done by calling flush before load or some API that generate a transition.
I'll try these solution later.

@lblb
Copy link
Author

lblb commented Jun 10, 2014

Thanks for looking into this. I tried your suggestion to flush(), but it doesn't really help.
I updated my test case a little:
http:https://jsfiddle.net/e7ZbT/1/

@masayuki0812
Copy link
Member

Thank you for trying. Umm.. Please give me some time. I'll try looking into this more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants