javascript - Using Google Charts API Generated Graphic in FPDF -


well, question in title. since graphics created javascript, , pdf generated on server side, wondering if there way (may hackish, not-so-beautiful way if necessary) include these graphics pdf generated using fpdf.

example of chart i'd include: https://jsfiddle.net/srm8gzqg/3/ chart.draw(data, options);

edit: im despairing, since haven't found 1 php alternative in can create graph in fiddle. requirements following:

  • lines top bottom
  • input data can have float values
  • axis on left , bottom correct label orientation etc.

i found no library written in php can output image file (jpg, png, etc) given requirements. hint highly appreciated

here jsfiddle example of google chart rendered image. can put "printable version" in pdf.

google charts have getimageuri method provides png of chart created.

  // wait chart finish drawing before calling getimageuri() method.   google.visualization.events.addlistener(chart, 'ready', function () {     chart_div.innerhtml = '<img src="' + chart.getimageuri() + '">';   }); 

Comments