0

I develop a graph to display a temperature in time. I don't know how to make a scalable zoom time axis with android plot.

I'm using this function to set limit border but it take only number param : I receive i simpleDateFormat as data time.

plot.getOuterLimits().set(minX : 0, maxX 9, minY : 0, maxY : 100);
TobiSH
  • 2,833
  • 3
  • 23
  • 33

1 Answers1

0

The Androidplot docs have a section about enabling pan & zoom.

For example, you could enable horizontal pan/zoom:

PanZoom.attach(plot, PanZoom.Pan.HORIZONTAL, PanZoom.Zoom.STRETCH_HORIZONTAL);

As far as setting the limits goes, it helps to remember that internally Androidplot is treating all values as numbers. Without seeing more code I can only assume that you are actually using epoch time long values on the x axis. Based on that assumption you can do this:

Date minTime = new Date(...) // earliest date to display
Date maxTime = new Date(...) // latest date to display
plot.getOuterLimits().set(minTime.getTime(), maxTime.getTime(), yourMinY, yourMaxY);
Nick
  • 8,181
  • 4
  • 38
  • 63