MP Android图表从右向左滚动数据 [英] Mp Android Chart Scrolling the data from right to left

查看:218
本文介绍了MP Android图表从右向左滚动数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MpAndroid图表库构建条形图,我大约有50-60条,想要显示最初的60条,即显示ArrayList中的最后一个元素,滚动方向应该是从右到左.

I'm Building a barchart using MpAndroid chart library, i've around 50 - 60 bars and wanted to display the 60th initially i.e. display the last element in the ArrayList and the scroll should be from right to Left.

主要目的是在图表条形图的初始加载期间显示图表的结尾.

Main motive is to display the end of the chart during the initial load of the chart barchart.

预先感谢.

推荐答案

这对我有用.

chart.setData(...); // first set data

// now modify viewport
chart.setVisibleXRangeMaximum(20); // allow 20 values to be displayed at once on the x-axis, not more
chart.moveViewToX(10); // set the left edge of the chart to x-index 10
// moveViewToX(...) also calls invalidate()

请检查此以获取更多信息,文档

Check this for more information, doc

这篇关于MP Android图表从右向左滚动数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆