Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Pie chart can't setData #810

dnschnur opened this Issue Sep 28, 2012 · 4 comments


None yet
2 participants

dnschnur commented Sep 28, 2012

Original author: zengge1...@gmail.com (August 08, 2012 06:40:51)

in line chart ,update data can only invoke setData.but in pie chart,
must init chart again.
in pie chart,use variable processed to mark chart has processed the data,when setData,the method processDatapoints will not execute.
so ,I think you can set processed=false in draw of pie.

Original issue: http://code.google.com/p/flot/issues/detail?id=731

Is there a workaround to use setData ? The pie is not drawing.

I tried playing with "processed" and hooks but my comprehension of the code is limited and it did nothing.


dnschnur commented Jan 17, 2013

A work-around for many situations is to simply call $.plot with your new data.

Thanks, it's that simple and it works. Will do for now.

Doesn't seem very efficient though :)

@ghost ghost assigned dnschnur Feb 3, 2013

dnschnur added a commit that referenced this issue Feb 3, 2013

Set processed back to false after processing.
This temporary fix addresses the problem described in #810, and possibly
#945, where calls to setData for a pie chart do nothing.

dnschnur commented Feb 3, 2013

This is now fixed in master, by setting processed back to false after all series have been processed, as suggested.

The processed flag is quite a hack, but is necessary due to the fact that Flot provides no other way for plugins to alter the list of series. When we address this in 0.9 we should be able to get rid of the variable entirely.

@dnschnur dnschnur closed this Feb 3, 2013

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