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

Flowing grouped data #1068

Open
rhenna opened this issue Mar 18, 2015 · 4 comments
Open

Flowing grouped data #1068

rhenna opened this issue Mar 18, 2015 · 4 comments

Comments

@rhenna
Copy link

rhenna commented Mar 18, 2015

When calling .flow() on grouped data when values are also being pushed off the chart causes an error. Here's an example: http://jsfiddle.net/zavy2cwu/

It also causes some interesting looking results when using a bar chart: http://jsfiddle.net/3jhLau3u/

If flow doesn't push any data off the chart (length: 0), everything seems to be fine: http://jsfiddle.net/aL0sjLkz/

If the data isn't grouped, there aren't any errors, but with bar chart the animation compresses the bars and they expand out again: http://jsfiddle.net/fu41zeg8/

@mtolek
Copy link

mtolek commented May 7, 2015

I struggle with the same issue. If the data are not grouped the problem doesn't occur -
http://jsfiddle.net/z2erLqgx/24/
While grouping after calling the .flow() method the chart is not rendered properly -
http://jsfiddle.net/z2erLqgx/23/
Console error is:
Uncaught TypeError: Cannot read property 'value' of undefined - c3.js 2736

@ghost
Copy link

ghost commented Jul 11, 2015

Hi. I encountered this problem and spent some time yesterday trying to find a proper fix on my own. While looking into this problem I discovered that the targets' values arrays become misaligned even while calling chart.flow() with grouped data of equal lengths. I think this is due to some sort of problem with older values being added or dropping off (with d3 enter/update/exit pattern) midway through the flow, before all targets have done so. Then, before all targets are updated, generateGetBarPoints() triggers getShapeOffset() with the misaligned target value arrays. I'm not familiar with the codebase to make an accurate call here though.

A while into this attempt I discovered issue #1065. It does indeed fix the problem for us here too. Very thankful for that from @craigsoules!!

I just wanted to let you two know and get a bit more information on this problem out there, in case anyone else encounters it. Hopefully this can get fixed in the project properly for an upcoming release.

@ghost ghost mentioned this issue Jul 11, 2015
@masayuki0812
Copy link
Member

I merged #1065 #1275 and this will be released in 0.4.11 shortly!

@say8425
Copy link

say8425 commented Jan 19, 2016

I think this is not fixed yet.
When timeseries x axis is added, then bar is fall down.
http://jsfiddle.net/say8425/h7a8q6r9/8/

But when I use 4c193b0 instead of current commit(0d9f1e2) then it looks work.
And I found current commit has miss some if condition and break point.

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

No branches or pull requests

4 participants