Here's a look at the data source and Listener function:
Data Source
var data = new google.visualization.DataTable(
{
cols: [{ type: 'string', label: 'Col1' },
{ type: 'number', label: 'col2' },
{ type: 'boolean', label: 'MyBoolean' }],
rows: [
{ c: [{ v: 'data1' }, { v: 1 }, {v: false}] },
{ c: [{ v: 'data2' }, { v: 2 }, {v:true}] }
]
});
Listener Function :
function ChartSelect()
{
var selectedItem = chart.getSelection()[0];
console.log(dataSource.getValue(selectedItem.row, 1));
}
The following line is expected to throw an error:
console.log(dataSource.getValue(selectedItem.row, 1));
If I click on the first row, how can I retrieve the value of the second element in the data source (i.e. '1')?
Thank you