How to set Viewport Range via values at MpAndroidChart?

不想你离开。 提交于 2019-12-11 16:50:57

问题


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?

Is there any method to setXRange(leftXValue, rightXValue)?


回答1:


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);

than you have to move your view so that the values are visible from the 500th position

mChart.moveViewToX(499);


来源:https://stackoverflow.com/questions/46930860/how-to-set-viewport-range-via-values-at-mpandroidchart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!