function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Chart Downlaod


i am using charts simiral to that of google charts

now my requirement is to i need those chrts to be downlaoded to

my local machine, so i prviously used




the file is being downloaded but , the problem here is that the

chart is not being shown on the downlaoded page and the remaining content

associated with the chart is downloaded,

so could anyone help me what has to be done to download the entire chart and

what has to be used with contentType ,

could anyone help me with the sample code or the way i could achieve this


Thanks in advance..!


This sounds like the charts are being created via javascript, which is interpreted and executed by the browser when displaying HTML.  When the browser receives a content type of pdf, it will use an appropriate plugin to render the page and this won't have any concept of javascript.


If you are using chrome, you can try rendering the page as HTML and then printing to PDF - this worked for me with dojo charts.  It may work for other browsers too, but I haven't verified that.


Bob is correct. Charts displayed via google charts or other API's that draw them using svg or similar will not render on a VF page when outputting to PDF...



The only workaround I have found so far is to use google image charts, or some form of implementation using highcharts that gets the image files and uses them to create the PDF...I have not coded the highcharts version but I have successfully tested the google image charts and they do work in the VF pdf format.


I have also not used the SFDC charting but I believe it is svg based as well and thus would present the same issue.


One issue I found with google image charts was that they weren't reliably every time over https.  I suspect this was down to the number of calls being made on a daily basis.