2

I want to display chart with Y-axis on the right side using AndroidPlot library. I tried to use

 plot.getGraphWidget().setRangeAxisPosition(false, false, 0, s)

and

 plot.getGraphWidget().setRangeAxisLeft(false);

But it's useless. Only labels were moved to right side.

Is there any way to draw Y-axis on right side of AndroidPlot chart?

1 Answers1

3

I have found solution. I looked inside the AndroidPlot library and found, that axis drawing by offset named "origin". When you want to draw Y-axis on the right side of chart use this code.

XYPlot plot;
...
plot.calculateMinMaxVals(); 
plot.setUserDomainOrigin(plot.getCalculatedMaxX());