Any suggestions on exporting Charts in Views to PDF? Tried a couple of simple approaches:

  1. Am currently using Highcharts (to see if the license is worth it) and cannot get the 'Export' button to work http://www.highcharts.com/docs/export-module/export-module-overview within Drupal.
  2. I've also tried the Print module, but the best I've achieved is via TCPDF and there's a big blank space where a chart should be.

It seems that Highcharts renders the image as SVG, and it seems that Google Charts do the same... All Charts seem to to print fine from the browser, but I currently don't seem to be able to go straight to PDF.

Any thoughts?

Comments

Pierre.Vriens’s picture

The issue you ran into seems to be quite common for most charting related modules ...

Just in case it's an option to consider another module for charting, you may want to check the Comparison of Charting modules that I created recently. After doing so, you'll notice that, to my knowledge, there is only 1 module that provides such PDF support related to charts, i.e. Forena Reports (of which I'm a co-maintainer). To do so, you've the option to either use the (free) mPDF library, or otherwise some commercial lib.

If you find other charting modules or PDF related modules that solve your issue, I'd be curious to hear about that (so that I can also add it to the comparison mentioned above).

Anonymous’s picture

You could add exporting.js from "sites/all/libraries/highcharts/js/modules/" to the page on which the view is being displayed ( using drupal_add_js). The button is now shown on each chart on the page.

Alternatively, you could use print module with wkhtmltopdf and add the following to
wkhtmltopdf options : --footer-font-size 7 --footer-right '[page]' --javascript-delay 40000 --no-stop-slow-scripts

under PDF tab -> wkhtmltopdf

karibou-mtl’s picture

Hi,

If I want add button for global results, how can I make ?
I have 10 charts in a page and I want print to pdf (ALL charts).

TKS

andileco’s picture

Following up on @shivadixith's comment, see my post here: https://www.drupal.org/node/2730255#comment-11322433

I included code for adding the exporting.js file via a custom module.

andileco’s picture

Status: Active » Closed (outdated)

With Drupal 7 having reached EOL, I am closing all D7 tickets that do not have a patch.