Grab chart object using containerId

11 views
Skip to first unread message

AL

unread,
Apr 21, 2016, 2:25:22 PM4/21/16
to Google Visualization API
Hello,

How would I grab the chart object I'm using if I was to use the containerId? 

The pie chart is: 
chart = new google.visualization.ChartWrapper({
               
'chartType': 'PieChart',
               
'containerId': myContainer,
               
'options': {
                   
'pieSliceText': 'value',
                   
'legend': legend,
                   
'chartArea': {'left': 20, 'top': 10, 'right': 10, 'bottom': 20},
                   
'pieSliceText': 'value'
               
}
});

This code section is run many times to create multiple charts. Therefore, "chart" would keep changing to the most recent chart created inside different divs, so I can't just call chart.

How would I grab the specific chart if I have the container div?

Thanks.
Reply all
Reply to author
Forward
0 new messages