0
votes

I have to draw a graph on android with:-

  • X-axis's labels starting from the right-hand side of the graph and ending to the left. (i.e; label with low value positioned on the right while labels with higher values positioned left)

  • Y-axis positioned on the right side of the graph.

I have tried graphview (library) in android but could not find a way to plot x-axis from right to left manner. (As explained above) However, managed to plot Y-axis. (As managed above).

Tried MPChart (library as well) unfortunately that also did not work.

Any suggestion or idea will be a great help.

I am attaching the image as well for you to understand what exactly I want my graph to look like.SEE IMAGE HERE

1

1 Answers

0
votes

If the input data is not dynamic you can always graph it it in reverse order by reversing the Array/List and plotting it normally. I've had to use some hack around code to rotate my Graph to make the x axis on the left and y axis on the bottom using MPAndroidChart. But it seems like you already tried attempted that solution, so I honestly would just reverse graph it.

Something like : Collections.reverse(Arrays.asList(a));

"For all my graphing needs I used: MPAndroidChart This guy made a awesome library and so easy to implement it has really good doceumation to get started found here: MPAndroidChartDocumentation"