While using AChartEngine (JAR 1.0.0) for Android, I see a method that allows me to change the color of text for X-Axis (mRenderer.setXLabelsColor(Color.BLACK)
)
Unfortunately I am unable to find a corresponding method for the Y-Axis labels!
Also is there a way to set the color of the actual line graph?
I also tried to align the labels to the left of Y-Axis using
mRenderer.setYAxisAlign(Align.LEFT, 0);
mRenderer.setYLabelsAlign(Align.LEFT, 0);
but it does seem to function.
There is renderer.setYLabelsColor();
for setting the Y axis label color.
When you use Align.LEFT, it means they are left aligned, if you want to right align them on the left side of the axis, use Align.RIGHT
.
The line graph color is the one from its own renderer.
To align and set a color properlly you need put it as follow:
mRenderer.setYAxisAlign(Align.LEFT, 0);
mRenderer.setYLabelsAlign(Align.RIGHT, 0);
// setYLabelsColor method you need include which the
// int for your YLabel, since this library you can
// use more than one YLabel, so in your case,
// you only have one YLabel and its index is 0.
mRenderer.setYLabelsColor(0, Color.BLACK);
mRenderer.setXLabelsColor(Color.BLACK);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With