Reputation: 151
I am using google visualization for drawing a 3d chart. I use - greg.ross.visualisation.SurfacePlot(). I am drawing chart in iframe. If I call the method draw() once, the chart gets plotted properly. But, after that calling draw() again doesn't make any change. It doesn't draw the chart again. Can anyone help me in this? I want to draw the chart again & again depending on user input. Is there any way to redraw the chart? or is tehre any way to flush the existing chart?
& one more question - why this is happening?
Upvotes: 0
Views: 309
Reputation: 1
Reuse the "draw()" function. example :
/*************************************************************************/
/* Redraw charts on window resize (only if responsive option is TRUE */
angular.element($window).bind('resize', function () {
if (googleTreeChartsResponsive) {
$timeout(function () { googleChartsInstance.draw(data, googleTreeChartsOptions) }, 250);
}
});
From : http://codepen.io/vage/pen/KdoBRr (resize the window, the charts will be redraw() )
Upvotes: 0
Reputation: 77
How do I delete a google chart and replace it with a new one in a google app?
Try this
/* Clear chart Panel */
var chartPanel = app.getElementById('chartPanel');
chartPanel.clear();
Upvotes: 1