c3js / c3js/c3

Loading data corrupts chart if previous transition is not finished

Open
#337 3 comments 0 reactions 0 assignees View on GitHub
C-bug
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the rapid data-load scenario from the linked JSFiddle, especially with grouped bar charts, and trace the chart loading and transition flow. The fix is done when repeated loads before a transition finishes leave both grouped and simple bar charts consistent and usable for later loads.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3, javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.