SetSelection function not working as expected
I added a ref to the chart component and am calling: this.refs.userVisitPieChart.wrapper.getChart().setSelection([{row: 1, column: null}]
It looks like this.refs.userVisitPieChart.wrapper.getChart().setSelection is exposed correctly by the chart wrapper, but the setSelection function with an argument does not augment the Pie Chart as intended.
Hey,
Could you provide some code I can run, to help debug this issue ?
Bump
I'll create a new issue if this one isn't monitored anymore. I'd also like to see setSeleciton work, which is not defined anywhere in types.d.ts that I can find.
https://developers.google.com/chart/interactive/docs/events
The chart should expose the method setSelection(selection) to change the selection in the underlying table and select the corresponding data in the chart.
I'm trying to set the selection to show all the tooltips on chart load. Thanks for the awesome library by the way.
Hey @EricKit,
Could you provide some minimal code I can run, to help debug and fix this issue ?
I very well may be missing something. I would expect the setSelection method to be available on a chart.
const chartEvents: [ReactGoogleChartEvent] = [
{
eventName: 'ready',
callback({ chartWrapper }) {
const table: GoogleDataTable | null = chartWrapper.getDataTable();
if (table) {
const selectedRows = [];
for (var i = 0; i < table.getNumberOfRows(); i++) {
selectedRows.push({ row: i, column: null });
}
chartWrapper.getChart().setSelection(selectedRows); // This does not exist
}
},
},
];
any update on this?
There is no setSelection in the types.d.ts either. Any updates?