Loading data corrupts chart if previous transition is not finished
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://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.
Hi, I agree to fix this issue. I think this solution might work:
- Detect duplicated transition
- If detected, call
flushto 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.
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://jsfiddle.net/e7ZbT/1/
Thank you for trying. Umm.. Please give me some time. I'll try looking into this more.