Mp Android Chart Scrolling the data from right to left

非 Y 不嫁゛ 提交于 2020-01-02 05:33:07

问题


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.

Thanks in Advance.


回答1:


This worked for me.

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



来源:https://stackoverflow.com/questions/33605808/mp-android-chart-scrolling-the-data-from-right-to-left

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