benkeen / d3pie

A configurable pie chart lib and generator built on d3.js
MIT License
371 stars 203 forks source link

Chart flickering in live update when effects set to false #116

Open Snookmz opened 7 years ago

Snookmz commented 7 years ago

I have wrapped d3pie.js in a directive in my Angularjs app. I want to refresh the data every second and I find that the chart 'flickers'. Meaning it disappears briefly before it is redrawn. This causes a discomforting feeling for the user.

There is functionality within the d3pie library to update the chart with new data:

http://d3pie.org/website/examples/update_data.html

I have created a plunker to show what's happening.

https://plnkr.co/edit/gfWag4mJdwnvkcs17jTY?p=preview

One possible issue is that I've turned off all effects (so that it doesn't do the fancy redraw), this is because if I update every second the redraw will look way to busy.

I am not sure if it's a problem with the d3pie charting library itself, the way I'm using it in a directive, or something else I haven't thought of. I've used other angularjs charting libraries to create live charts which don't have this flickering issue.

Any ideas?