google_visualr icon indicating copy to clipboard operation
google_visualr copied to clipboard

Support for PNG url?

Open Deekor opened this issue 9 years ago • 4 comments

Does this gem support the png printing functionality? https://developers.google.com/chart/interactive/docs/printing

I would like to just get the URL of a chart to stick into an email.

Deekor avatar Nov 19 '15 18:11 Deekor

The gem supports adding listeners now, see:

  • https://github.com/winston/google_visualr/blob/master/lib/google_visualr/base_chart.rb#L55
  • https://github.com/winston/google_visualr/blob/master/spec/google_visualr/base_chart_spec.rb

So it could be possible to have the PNG functionality. A convenience helper method can be added to the gem to make that easier too.

However you won't be able to directly use it in your email because most (all?) email clients will not allow JavaScript to run, and hence it's not possible to just use the chart functionality directly in emails.

It will be a two step process where you need to get the URLs manually before putting them in emails.

Hope this answers?

winston avatar Nov 20 '15 02:11 winston

any news? if you could directly turn the chart in PNG, I could add the image to a pdf file ( with Prawn ) or other type of file that does not support javascript

francesco-loreti avatar Jun 28 '16 12:06 francesco-loreti

I ended up using Google's deprecated image charts: https://developers.google.com/chart/image/

Deekor avatar Jun 28 '16 15:06 Deekor

Ok but if I want convert the Gantt chart or Timeline chart into png?

francesco-loreti avatar Jun 29 '16 08:06 francesco-loreti