18

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

  • 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. – David Gillen Nov 15 '13 at 11:25
  • This question has been asked in 2013 ---is is still an issue in 2017 ? – unidha Feb 23 '17 at 2:47
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.

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.