ag-grid version: 26.0.0 enterprise
I'm trying to trap the range selection for a chart when using the navigator range selection handle but my onChartRangeSelectionChanged function is not getting invoked.
When I run the Chart Events sample in a separate window and change the range either using the handle or selecting/deselecting series in the legend I do not see output in the console from the onChartRangeSelectionChanged function:
function onChartRangeSelectionChanged(event) {
console.log(
'Changed range selection of chart with ID ' + event.chartId,
event
);
}
The documentation indicates that the event will fire when the handle is dragged:
ChartRangeSelectionChanged
This is raised any time that the data range used to render the chart from is changed, e.g. by using the range selection handle or by making changes in the Data tab of the configuration sidebar. This event contains a cellRange object that gives you information about the range, allowing you to recreate the chart.
A little more experimentation indicates that when a change is made to the series selection in the chart menu data tab an event is generated.
I believe I found the answer.
Changes made to controls in the chart canvas (either clicking a series legend to show remove a series or adjusting the "navigator" slider activated from chart menu/format/navigator/enable) only change the chart display in the canvas. They do not affect the "chart range" which continues to refer to all the data in the table.
To change the chart range the "range selection handle" is a little square at the bottom right of the selected data in the table. Also the chart menu/data/series panel can be used to select the series to chart.
There does not appear to be a documented way to capture changes to settings within the chart canvas.