Abhay Maniyar
Abhay Maniyar

Reputation: 129

To and fro auto scroll LineChart in MPAndroidChart

First of all, MPAndroidChart is a great Library. I implemented a LineChart and everything went like a breeze. I want to make my LineChart auto scroll to and from to both the extreme points. How can I achieve that?

Upvotes: 0

Views: 342

Answers (2)

Manisha
Manisha

Reputation: 873

You can use -

  chart.moveViewToAnimated(chart.data.entryCount - NUMBER_OF_MONTH_DATA_TO_SHOW, chart.centerOfView.y, chart.axisLeft.axisDependency, 3000);

Upvotes: 0

Truong Viet Hoang
Truong Viet Hoang

Reputation: 46

Try this one:

mChart.setVisibleXRangeMaximum(size);
mChart.moveViewToX(valueX);

Upvotes: 1

Related Questions