I used https://github.com/google/charts inside my flutter app. It works great. But when i zoom on chart, the zoom happens but in the wrong place! It starts expanding keeping the left static. The effect is the chart slide under your finger zooming not in the point you are zooming to. Is there a way to zoom like you zoom on a picture on gallery?
code of my chart
Widget build(BuildContext context) {
return new charts.LineChart(
_chartSeriesFromChartData(seriesList),
animate: false,
defaultRenderer: charts.LineRendererConfig(includeArea: true, includePoints: true),
primaryMeasureAxis: charts.NumericAxisSpec(tickProviderSpec: charts.BasicNumericTickProviderSpec(desiredTickCount: 8)),
behaviors: [ZoomBehaviour()],
)
Run Code Online (Sandbox Code Playgroud)
小智 10
你可以在你的代码中使用这样的代码:
behaviors: [new charts.PanAndZoomBehavior()],
Run Code Online (Sandbox Code Playgroud)
或者,如果您想在我们的图表中按项目进行选择,您可以使用:
behaviors: [new charts.SeriesLegend()],
Run Code Online (Sandbox Code Playgroud)
如果你想使用其中的两个,也许你可以使用:
behaviors: [new charts.SeriesLegend(), new charts.PanAndZoomBehavior()],
Run Code Online (Sandbox Code Playgroud)
祝你好运快乐编码
| 归档时间: |
|
| 查看次数: |
3693 次 |
| 最近记录: |