vikram
vikram

Reputation: 83

display recent plotted value on AChartEngine dynamic line graph

When I dynamically plot values I wish to display the recent plotted value on line graph (drawn with the help of AChartEngine library). In other words I wish to scroll my line graph along x-axis towards left to show the latest plotted value and hide the oldest plotted value. How to achieve this?

Upvotes: 2

Views: 289

Answers (1)

Dan D.
Dan D.

Reputation: 32391

Whenever you add values to the datasets, if you call chartView.repaint(); the chart is updated with the new values.

In order to have the values scroll to the left, you need to change the visible area on the X axis:

renderer.setXAxisMin(theMinimumVisibleValue);
// this may be optional
// renderer.setXAxisMax(theMaximumVisibleValue);

Upvotes: 1

Related Questions