user404157
user404157

Reputation: 21

How to convert Google Gauge Chart in PDF Format

I just want to know how to convert Google Gauge Chart in PDF Format.

Is there any way to get a url for gauge chart like bar chart and pie chart, which I have sent and received respective gauge chart in PDF format.

Upvotes: 1

Views: 1544

Answers (2)

Hassaan Anjum
Hassaan Anjum

Reputation: 11

Yeah you can try to convert the google chart to a canvas and then get png image data from that, this will allow you to send png image data to libraries such as FPDF in which you can save the image as a PDF. Google charts are created using SVG ... to convert SVG to canvas you can use the library canvg. It works like canvg(yourCanvas, yourSVG) then use var PNGimg = canvas.toDataURL("image/png"); This should pretty much do the trick

Upvotes: 1

diegogs
diegogs

Reputation: 2076

There isn't a simple way to do this. Since visualization charts with google are made with javascript you are pretty much helpless if you want it as an image.

Upvotes: 0

Related Questions