Reputation: 257
I'm using MPAndroidChart to create a horizontal bar graph.
Is it possible to justify the label text from the left as opposed to the right?
Code:
mChart.getXAxis().setValueFormatter(new LabelValueFormatter(set1));
mChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM_INSIDE);
mChart.getXAxis().setXOffset(100);
Upvotes: 0
Views: 3047
Reputation: 257
Setting the axis position to the TOP and reversing the offset worked:
mChart.getXAxis().setValueFormatter(new LabelValueFormatter(set1));
mChart.getXAxis().setPosition(XAxis.XAxisPosition.TOP);
mChart.getXAxis().setXOffset(-350);
Upvotes: 1
Reputation: 74
you can set to draw the values above the bars by:
mChart.setDrawValueAboveBar(true);
the result is like this image.
Upvotes: 0