TomNeyland / angular-dc

AngularJS directives for dc.js
http://tomneyland.github.io/angular-dc/
MIT License
112 stars 58 forks source link

how to properly refresh crossfilter dataset and render d3 piechart #13

Open sallespro opened 10 years ago

sallespro commented 10 years ago

i would like refresh crossfilter dataset and render the chart once in a while.

the crossfilter is initialized and after some new data arrives, i tried to

          ndx.remove();
          ndx = crossfilter(new_dataset);

plus redefine dimensions & groups...

and then

dc.renderAll(1);

but it doesn't seem to reset crossfilter, but i can see the chart redraw.

what's the proper way to do it ?

TomNeyland commented 10 years ago

@sallespro I am having a bit of trouble replicating this, could you possible put together a jsfiddle or codepen?

sallespro commented 10 years ago

hey @TomNeyland, yes, i'll do so.

AFAIK the directive would be hindering the rendering ( drawing ) with the new dataset, despite crossfilter is in fact updated.

i thought i should do it without the angular directive instead, or does it occur to you a way with the directive ?

deebuls commented 9 years ago

I wanted to do the same issue . crossfilter is initialized with new data as new data comes. The corssfilter and the dimension are updated in $scope. But the charts are not redrawn with the new crossfilter values

How to explicitly redraw the charts

TomNeyland commented 9 years ago

I am going look into this the next time I have a chance to go through knocking out issues.

@deebuls @sallespro would you be able to put together at JSFiddle that demonstrates the problem? It would aid me in understanding and resolving this quicker.

kenda commented 9 years ago

I struggled here too. Any news on this?

@deebuls @sallespro Have you found any appropriate workaround in the meantime?

toddlamothe commented 9 years ago

Was a JSFiddle submitted for this or was the issue resolved? Also running into trouble refreshing pie charts after updating crossfilter values.

Happy to put together a Fiddle if needed.

TomNeyland commented 9 years ago

@toddlamothe I'd love if you could put a fiddle together.

I am traveling until 9/18 so my ability to look into this before then is limited, but having a fiddle will help me greatly when I get back.

toddlamothe commented 9 years ago

having trouble with the jsfiddle. code is there but the pie chart won't render:

https://jsfiddle.net/lamothe/z1c07pha/13/