如何通过MpAndroidChart中的值设置视口范围? [英] How to set Viewport Range via values at MpAndroidChart?
本文介绍了如何通过MpAndroidChart中的值设置视口范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的数据集值在[0-10000]范围内.
我想在图表中看到具有自动计算的滚动和缩放值的范围[500-600].
如何在MPAndroidChart中完成?
I have dataset values at range [0-10000].
And I want to see range [500-600] at chart with automatically calculated scroll and zoom values.
How it can be done in MPAndroidChart?
有什么方法可以设置setXRange(leftXValue,rightXValue)?
Is there any method to setXRange(leftXValue, rightXValue)?
推荐答案
首先设置最大可见范围. 因此,如果要显示500-600的范围,则将最大可见范围设置为100
First set the max visible range. So if you want to display the range of 500-600, set a max visible range of 100
mChart.setVisibleXRangeMaximum(100);
您不必移动视图,以便可以从第500个位置看到这些值
than you have to move your view so that the values are visible from the 500th position
mChart.moveViewToX(499);
这篇关于如何通过MpAndroidChart中的值设置视口范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文