I am trying to familiarize with charts in Flutter, using github.com/google/charts package.
I want to make a chart (bar, line, scatter or any other.. this, for example) where I can zoom and pan not only the x-axis, but also the vertical y-axis (abscissa).
The zoom in x-axis is working adding the behavior behaviors: [new charts.PanAndZoomBehavior(),]
:
@override
Widget build(BuildContext context) {
return new charts.BarChart(
seriesList,
animate: animate,
behaviors: [new charts.PanAndZoomBehavior(),
],
domainAxis: new charts.OrdinalAxisSpec(
viewport: new charts.OrdinalViewport('2018', 4)),
);
}
the x-axis zoom is not centered, as asked in this question, but it's ok to me.
A first step would be disable the auto-fit of the vertical axis is adjusting the range between 0 and the max value of the data that appear in that moment in the chart.
Any idea how to enable zoom gesture on the y-axis or at least disable the auto-fit of y-axis (fix the range of y-axis)?