You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have added the feature to export to PNG. As chart.getImageURI() works only on corecharts and geocharts, it was not possible to provide the export option for google datatables. Also, chart.getImageURI() provides access to a PNG image of a chart only.
To use this feature, just do plot.export('png', 'file_name') and the chart will be downloaded as the png file.
I am working on how to export the chart to pdf also. Further, if possible I will try to add the button (just like in highcharts) to export the googlecharts in different formats in a separate PR.
There is a bug that whenever we update the GoogleCharts jsapi (https://www.google.com/jsapi), GoogleCharts produces an error in IRuby notebook and do not work. For now, I have commented out that portion to update jsapi.
Error produced is:
Javascript error adding output!
TypeError: right-hand side of 'in' should be an object, got undefined
See your browser Javascript console for more details.
Regarding exporting to pdf format:
I have used jspdf which is working fine in rails app but again is producing an error in IRuby notebook as the jspdf dependency is not loaded properly in IRuby notebook.
I have searched for another idea using cloudformatter (examples) based on this example. I have also tried out an example using the above but again I am not sure if it will work in IRuby notebook. This is good because we can provide buttons as in highcharts (1. both for google datatables and charts, 2. Provides export in pdf, jpg and png format ).
Right now in this PR, export to PNG format is done ( for corecharts and geocharts ). I have tried exporting to PDF and JPEG too using cloudformatter and jspdf in this PR but they were not working in IRuby notebook. I have commented out the examples in this notebook.
Refer this comment for PNG exporting.
Refer this comment for PDF and JPEG exporting
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have added the feature to export to PNG. As
chart.getImageURI()
works only on corecharts and geocharts, it was not possible to provide the export option for google datatables. Also,chart.getImageURI()
provides access to a PNG image of a chart only.To use this feature, just do plot.export('png', 'file_name') and the chart will be downloaded as the png file.
I am working on how to export the chart to pdf also. Further, if possible I will try to add the button (just like in highcharts) to export the googlecharts in different formats in a separate PR.