When I control the trackball, onTrackballPositionChanging gets called (which is correct behavior) but in addition, onZooming also gets called, which is not desired behavior as I am working with synchronized charts and as such performance suffers when onZooming gets called each time without it needing to be called. The opposite happens as well, when I pan (using the onZooming method) the onTrackballPositionChanging method gets called as well. I have pasted a small part of the code below:
Some extra information, both pinch to zoom (x-axis only) and panning are enabled. and trackball has 'shouldAlwaysShow' set to true,
Thank you in advance,
Luca
onTrackballPositionChanging: (TrackballArgs args) {
if (!simulationManager.chartLock) {
simulationManager.chartLock = true;
simulationManager.simulations.forEach((simulation) {
if (simulation.id != widget.id) {
simulation.key.currentState.trackball.showByIndex(args.chartPointInfo.dataPointIndex);
}
});
simulationManager.chartLock = false;
}
},
onZooming: (ZoomPanArgs args) {
if (args.axis.name == 'primaryXAxis') {
simulationManager.setZoom(
widget.id,
args.currentZoomFactor,
args.currentZoomPosition
); // Storing the zoomPosition and the zoomFactor
}
},