bluejdesigns

Managed Printing Is Not Printing All Charts

Recommended Posts

I have a page with 6 charts on it. They display fine. When using the managedPrint() option to print the page, it only prints 3 of the charts. I enabled debug mode and I can see that three of the charts never finish to the "imagestreamready" event, yet the "printreadystatechange" event fires. I also see 'warning' log entries for the charts that do not print:

 

#31 [candlestickChart] fired "warning" event. #23091255 candlestickChart::DataHandler~update Warning >> Renderer update was postponed due to async loading.

 

Every once in a while I will also see this message on a chart that does print OK. I am including the debug output below. I did organize the debug output by chartID, rather than leave it in chrono order.

 

Thanks for any assistance you can provide.

 

-Brian

 

--------------------------------------------------------------------

Debug Output

--------------------------------------------------------------------

#19 [itemScoresChart] fired "internal.domelementcreated" event.

#25 [itemScoresChart] fired "dataloadrequestcompleted" event.

#26 [itemScoresChart] fired "beforedataupdate" event.

#27 [itemScoresChart] fired "warning" event. #23091255 itemScoresChart::DataHandler~update Warning >> Renderer update was postponed due to async loading.

#28 [itemScoresChart] fired "dataupdated" event.

#41 [itemScoresChart] fired "loaded" event.

#42 [engagementChart] fired "loaded" event.

#43 [itemScoresChart] fired "dataloaded" event.

#52 [itemScoresChart] fired "rendered" event.

#54 [itemScoresChart] fired "printreadystatechange" event.

#53 [itemScoresChart] fired "drawcomplete" event.

#61 [itemScoresChart] fired "imagestreamready" event.

 

#20 [compChart] fired "internal.domelementcreated" event.

#44 [compChart] fired "loaded" event.

#48 [compChart] fired "dataloadrequestcompleted" event.

#49 [compChart] fired "beforedataupdate" event.

#50 [compChart] fired "dataupdated" event.

#55 [compChart] fired "dataloaded" event.

#58 [compChart] fired "rendered" event.

#59 [compChart] fired "drawcomplete" event.

#63 [compChart] fired "printreadystatechange" event.

#62 [compChart] fired "imagestreamready" event.

 

#21 [candlestickChart] fired "internal.domelementcreated" event.

#29 [candlestickChart] fired "dataloadrequestcompleted" event.

#30 [candlestickChart] fired "beforedataupdate" event.

#31 [candlestickChart] fired "warning" event. #23091255 candlestickChart::DataHandler~update Warning >> Renderer update was postponed due to async loading.

#32 [candlestickChart] fired "dataupdated" event.

 

#22 [quest12Chart] fired "internal.domelementcreated" event.

#33 [quest12Chart] fired "dataloadrequestcompleted" event.

#34 [quest12Chart] fired "beforedataupdate" event.

#35 [quest12Chart] fired "warning" event. #23091255 quest12Chart::DataHandler~update Warning >> Renderer update was postponed due to async loading.

#36 [quest12Chart] fired "dataupdated" event.

 

#23 [quest14Chart] fired "internal.domelementcreated" event.

#37 [quest14Chart] fired "dataloadrequestcompleted" event.

#38 [quest14Chart] fired "beforedataupdate" event.

#39 [quest14Chart] fired "warning" event. #23091255 quest14Chart::DataHandler~update Warning >> Renderer update was postponed due to async loading.

#40 [quest14Chart] fired "dataupdated" event.

 

#24 [engagementChart] fired "internal.domelementcreated" event.

#45 [engagementChart] fired "dataloadrequestcompleted" event.

#46 [engagementChart] fired "beforedataupdate" event.

#47 [engagementChart] fired "dataupdated" event.

#51 [engagementChart] fired "dataloaded" event.

#56 [engagementChart] fired "rendered" event.

#57 [engagementChart] fired "drawcomplete" event.

#60 [engagementChart] fired "imagestreamready" event.

 

Share this post


Link to post
Share on other sites

This one drove me crazy for awhile too.  I managed to solve it by doing the ajax call manually and passing straight json to the chart:

 

$.ajax({
url: query
}).done(function (results) {
var chart = new FusionCharts({
swfUrl: "/FusionCharts/CandleStick.swf",
width: "100%",
height: '300',
renderAt: this.div,
dataFormat: "json",
dataSource: results
}).render();
}.bind({div: divName})
);

Share this post


Link to post
Share on other sites

Essentially, from this it can be inferred that when the chart's data is loaded by its internal AJAX mechanism, some of them fail to re-initiate chart export to canvas. Seems like when dataUpdated is fired by the data handler, the export to canvas hook is not notified. As such, the three charts that were even printing was because "by luck", it's chart's render event was fired before the data update!

Most likely, from the warning signs it seems the charts are running locally or on a super speed bandwidth and from that from a low bandwidth network it wouldn't have even fired for the three charts that was actually working.

 

I will look into the code and see what is lurking around and revert. Thanks "dshook" for the heads up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now