4

I have a graph where the information in the x Axis are dates. I want to limit the pan but I don't know how to do it with dates!

I found this question but has no answer yet!

AChartEngine Messed up labels

Thanks!

Solution: I did it in a very ugly way, so if anyone comes out with a better idea I would be happy to hear. What I did:

double[] limits = new double[] {xMin-(81300000 *3),xMax+(81300000 *3),yMin,yMax};

This way I limit it to three days before and after my first and last date.

Community
  • 1
  • 1
Lucia
  • 614
  • 1
  • 9
  • 30

1 Answers1

3

That solution's what I did too. Just set a static final double at the top of the graph activity

private static final double THREEDAYS = 86400000 *3;

then

double[] limits = new double[] {xMin-THREEDAYS ,xMax+THREEDAYS ,yMin,yMax};
RasTheDestroyer
  • 1,756
  • 16
  • 22