18

When using apex:chart, if the page has the renderAs="PDF", the charts don't show up at all.

2
  • This is something which has been asked recently of me, glad to see it asked here and an answer too. Now I know to tell the client he can't have that option. Nov 15, 2013 at 11:25
  • This question has been asked in 2013 ---is is still an issue in 2017 ?
    – unidha
    Feb 23, 2017 at 2:47

1 Answer 1

25

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.

3
  • 3
    One thing to watch out for is the image-based Google charts solution has been deprecated. The newer Google solution uses JavaScript too. Nov 15, 2013 at 15:21
  • That's correct. I'd forgotten about that. Server-side rendering seems to be going out the window...
    – sfdcfox
    Nov 15, 2013 at 16:32
  • That means, not possible to make the PDF files.
    – Sunny
    Aug 20, 2015 at 8:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .