saveAsImage - OnComplete Event
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



saveAsImage - OnComplete Event Expand / Collapse
Author
Message
Posted 4/28/2008 11:41:34 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 5/15/2008 10:23:51 PM
Posts: 11, Visits: 29
Is there a way to track the saveAsImage completion? I have several charts on a page, I have embedded these in an iframe and then I want to track when the saveAsImage completes. And when that happens I would like to retrieve the images from the cache and generate a PDF. Currently I am saving the images to Cache successfully, but would like to know when to invoke the PDF generation routine, without waiting for some arbitrary time. I cannot embed this logic inside imageSaveURL target since I am dealing with multiple charts. It would be really nice if in the next version we can have an elegant way of handling multiple charts without resorting to iframes.

Thanks!
Post #5992
Posted 4/29/2008 10:15:12 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 5/15/2008 10:23:51 PM
Posts: 11, Visits: 29
I have come up with a possible workaround. Use the iframe onload method to call another javascript function that will call a PDF generation routine. The process is as follows:

1. render multiple iframes with charts
2. add a button that when clicked calls the saveAsImage function on all iframes
3a. the saveAsImage passes the control to a http handler that creates the image and adds it to the cache
3b. the last step of the handler writes out a javascript history.go(-1)
4. step 3a/3b above is repeated for all iframes on the page
5. add an onload method on the last iframe which will react to the onload event when the history.go(-1) is called
6. this onload method will pass the control to a render PDF javascript function that will invoke a separate http handler that will read the images from cache and generate a pdf

if someone has a better method, please let me know.
Post #6012
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 11:00pm


Execution: 0.047.