-
Notifications
You must be signed in to change notification settings - Fork 26
ChartLoader fails if multiple charts are being placed on a page. #66
Comments
Looks like this is possibly a duplicate/regression of #58 . |
Hello @ccrvincent I am facing the same issue, and it is really annoying. I have two pie Charts which are generated at the same tame woth 2 data sources and only one gets painted. Could you please provide some hints of your solution? I have trying to make it work using GoogleApiLoader with no success... Thanks in advance! Saúl |
I no longer have access to the codebase where I was using this, so this is totally off of memory. I wrote a class that either extended or wrapped ChartLoader and used it to manage the callbacks myself. Something like this (VERY loose psuedocode): load(callback) { LocalCallback.run() { GoogleApiLoader was only referenced here as an example of how to manage the loader. I never used it directly with gwt-charts. |
Thank you very much @ccrvincent for your support and effort looking for this in your memory. I will give a try. Again, thanks a lot :) |
fugly workaround; replace all ChartLoaders with ConcurrentChartLoader;
|
We are using multiple different charts on a single page. Each one is a separate custom GWT Widget.
If more than one hits the ChartLoader concurrently, only the last callback is run.
The "official" GWT library solved this by keeping callbacks in a queue while loading is happening and emptying the queue after loading is complete.
https://github.com/googlearchive/gwt-google-apis/blob/master/apis/src/com/google/api/gwt/client/GoogleApiLoader.java
Easy enough to do in a loader wrapper (which is what I have done for now), but would be a good improvement to the actual ChartLoader.
The text was updated successfully, but these errors were encountered: