Custom position for bar values
There is no method in the API exposed for changing the position of the value labels to below the YAxis. You will probably have to extend and modify the library to meet your uncommon requirement.
One option to try would be to implement an IAxisValueFormatter
on the XAxis to render y-values instead of x-values. A simple example could re-use the existing IndexAxisValueFormatter
. Let's say you have the labels for the y-values in a String []
called yLabels
. You can now do this:
mChart.getXAxis().setValueFormatter(new IndexAxisValueFormatter(yLabels));
If that doesn't work, you will have to look at the source for BarChartRenderer
. There is a method called drawValues()
which you can override to achieve the effect you want.
So you would have something like:
public class MyBarChartRenderer extends BarChartRenderer {
//TODO: a constructor matching the superclass
@Override
public void drawValues(Canvas c) {
//TODO: copy and paste the code from the superclass and simply
//change the offset for drawing the labels
}
}