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.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/pqIEpfNZrTYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to