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
JaksonJakson 

displaying Charts in PDF format

to get Google Charts (Donut, Area) from a Visual force page to a PDF.
It works fine on the Visual force page but when we render that page as PDF the charts are not getting displayed on the PDF Page.
Kindly suggest us with a solution to achieve this functionality.
Ashish_SFDCAshish_SFDC

Hi Jakson, 


Visualforce Charts are rendered by JavaScript after the page has been initially rendered. PDF does not support JavaScript, and so those charts never have a chance to render before the PDF file is created.

This is in direct contrast to Google Charts, which are rendered as images on the Google server before being delivered. You will need to use a image-based chart solution, such as Google Charts, in order to generate charts within the PDF file.

See the below link for similar discussion,

http://salesforce.stackexchange.com/questions/20753/apex-charts-render-as-pdf


Regards,

Ashish

Dominic Blythe 18Dominic Blythe 18
Google Charts are also built of javascript and rendered in the browser https://developers.google.com/chart/ (http://https://developers.google.com/chart/)

Google Image Charts, https://developers.google.com/chart/image/  which are built on the google server and then delivered as images can be included in salesforce PDFs. But the Imag Charts API is deprecated as of April 20, 2012. The deprecation policy on it runs out on April 20, 2015. Which I think means that after that they can just switch it off. So I wouldnt recommend using it.