我正在使用MPAndroidChart,我该如何重置缩放?例如:
1. 用户在图表上进行了缩放
2. 用户点击一个按钮以重置缩放(回到默认缩放)
2. 用户点击一个按钮以重置缩放(回到默认缩放)
chart.fitScreen()
来重置缩放。这将重置图表视口到其原始状态(完全缩小)。zoom(float scaleX, float scaleY, float x, float y)
:按给定比例因子缩放。x和y是缩放中心的坐标(以像素为单位)。请记住,1f的比例 = 无缩放。zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis)
:按给定比例因子缩放。xValue和yValue是缩放中心的实际数据值(而不是像素)。请记住,1f的比例 = 无缩放。zoomAndCenterAnimated(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis, long duration)
:按指定的比例因子缩放,并以动画方式将视图窗口居中到指定轴上的指定值(v2.2.3或更高版本)。zoomAndCenterAnimated(1f,1f,0,0,AxisDependency.LEFT,500L)
)。