Reputation: 914
For the uninitiated, this is a trend line:
How do I do that in an Android charting library, like MPAndroidChart? I've already set up the necessary code to produce the needed line chart, but I have no idea how to overlay a trend line over it.
Upvotes: 1
Views: 2272
Reputation: 2030
You could calculate the trend line mathematically and add a new line to the chart for that new line. Here's a tutorial on how to calculate trend lines.
If you followed that tutorial it would give you the equation you could plug in some values to get the X and Y coordinates to plot on the chart.
Upvotes: 2