Is it possible to export google chart data to image format in angularjs?

586 views
Skip to first unread message

Vinay Yadave

unread,
Feb 28, 2017, 9:22:31 AM2/28/17
to Google Visualization API
Is it possible to export google chart data to image format in angularjs?

Arghya chakroborty

unread,
Mar 1, 2017, 4:18:07 PM3/1/17
to Google Visualization API
I guess you very well could.

But for this, you need to assign the chart object URI to a $scope variable. Something like this -

var chart = new google.visualization.ColumnChart(document.getElementById('canvas_dahs'));
chart.draw(data);

// Store this variable 
$scope.chartURI = chart.getImageURI();

Now, since you have the image uri already, you can introduce a button in your view , which once clicked will open a window with the URI above. Or you can opt for an anchor tag with url as the chartURI. But I would leave the implementation details on you.

Hope this helps....

Reply all
Reply to author
Forward
0 new messages