Mp Android Chart Scroll data from left to right.

I create barchart using the MpAndroid chart library, I have about 50-60 bars, and I wanted to display the 60th initially, i.e. display the last element in an ArrayList, and the scroll should be from right to left.

The main motive is to display the end of the graph during the initial loading of the graph chart.

Thanks at Advance.

+4
source share
1 answer

It 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 out for more info, doc

+8
source

Source: https://habr.com/ru/post/1615015/


All Articles