drawChartSelected(chart?) {
let loaded = false
this.wrapper = new google.visualization.ChartWrapper({
chartType: chart.options.chartType,
dataTable: chart.data,
options: chart.options || {},
containerId: chart.id
});
setTimeout(() => {
console.log(this.wrapper);
this.wrapper.draw();
}, 1000);
loaded = true;
this.events.publish('isLoaded', this.chartLoaded);
}Here is the code I use to draw the graph again. Can you see if this is correct or not? This is where I get my error, when I try to do this.wrapper.draw () quinta-feira, 4 de Maio de 2017 às 14:22:23 UTC+1, jose mendes escreveu: > > Hi all, > I'm working with the google charts on ionic 2 and by now I'm loving it. > > But I have a problem .. When I try to update the data in the graph it > gives me an error about the container. > > When the application starts I create 3 graphs dynamically, and what I want > to do is that when the user refreshes the page, the data of these graphs > are updated, without creating new graphs. > > > Error: > > ERROR Error: The container #3 is not defined. > at g (polyfills.js:3) > at gvjs_Z.gvjs_.getContainer (jsapi_compiled_default_module.js:240) > at gvjs_Z.gvjs_.draw (jsapi_compiled_default_module.js:236) > at google-chart-component.ts:63 > at t.invokeTask (polyfills.js:3) > at Object.onInvokeTask (core.es5.js:4136) > at t.invokeTask (polyfills.js:3) > at n.runTask (polyfills.js:3) > at invoke (polyfills.js:3) > at e (polyfills.js:2) > > > Anyone have any idea what it might be? > > Thanks! > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/19d3763b-c734-4c91-9340-75ee90a84a8d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
