Can you post a working example demonstrating the problem?
On Monday, November 5, 2012 4:56:46 AM UTC-5, Mozi wrote:
Hi
I'm having a strange issue with GetChart().
I have 4 chart wrappers on one page. Each chart wrapper has it's own var name and containerID. I've added a listener to each chart to catch when the user clicks on a specific column in a chart.
Regardless of which chart the user clicks on, getChart().getSelection() always returns the data from the first chart. If I check the container ID, it returns the correct ID, but getChart() always seems to reference the first chart. Why?
Below are 2 bits of code where I've setup a listener for the event.
google.visualization.events.addListener(chart, 'select', function () {
var selection = chart.getChart().getSelection();
var viewData = chart.getDataTable();
GetErrorDetails(viewData.getValue(selection[0].row, 0), viewData.getColumnId(selection[0].column));
});
google.visualization.events.addListener(chartFirstTest, 'select', function () {
var selection = chartFirstTest.getChart().getSelection();
var viewData = chartFirstTest.getDataTable();
GetErrorDetails(viewData.getValue(selection[0].row, 0), viewData.getColumnId(selection[0].column));
});
Thanks for any help.