MpAndroid CandleStick图表,查看最后的值 [英] MpAndroid CandleStick Chart, to see the last values
问题描述
我正在使用MPAndroidChart
库的蜡烛Stick Chart
.
就像我每10分钟显示一次2011年至今的财务数据一样.
所以我在一个屏幕上有很多蜡烛数据.
我使用放大了值,
I am using MPAndroidChart
Library's Candle Stick Chart
.
Like I am showing financial data from year 2011 tills date for every 10 minutes.
So I have lots of candle data in one screen.
I have zoomed in the values using,
candleStickChart.setVisibleYRangeMaximum(10, YAxis.AxisDependency.RIGHT);
candleStickChart.setScaleMinima(150f, 1.5f);
但是我必须向右滚动才能查看最后的蜡烛数据. 我已经阅读了文档,但是无法获取如何将屏幕固定为最新数据以向左滑动以查看前一个数据.
But I have to scroll to right to see the last candle data. I have gone through the documentations, but not able to get how to fix the screen to latest data to swipe to left to see the previous.
推荐答案
尝试一下:
mChart.moveViewToX(xVals.size());
//Here mChart is your chart object and xVals contains values of X axis.
此答案将解决您的问题.
This answer will solve your problem.
mChart.setVisibleXRangeMinimum(7);
mChart.setVisibleXRangeMaximum(7);
这将一次在屏幕上显示最多和最少7支蜡烛.要查看更多内容,您必须滑动.
This will show maximum and minimum 7 candles in screen at a time. To view more you have to swipe.
这篇关于MpAndroid CandleStick图表,查看最后的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!