ketan ketan - 3 months ago 14
Android Question

Give space between line and label value in achartengine

I have created achartengine line chart for my application. All works perfect but Y axis label and line both mixed up.

And also result value display on above the line.

You can check in below image. Label is on line.

enter image description here

I have tried for Y axis.

XYMultipleSeriesRenderer multiRenderer = new XYMultipleSeriesRenderer();
multiRenderer.setYLabelsPadding(10);
multiRenderer.setYLabelsAlign(Paint.Align.LEFT);


And for result value.

SimpleSeriesRenderer incomeRenderer = new SimpleSeriesRenderer();
incomeRenderer.setLineWidth(3);
incomeRenderer.setDisplayChartValues(true);
incomeRenderer.setChartValuesTextSize(35.0f);
incomeRenderer.setChartValuesTextAlign(Paint.Align.CENTER);


Any help would be greatly appreciated.

Answer

Please download latest jar file for achartengine. Because this properly is available after version 1.1.0.

After use

multiRenderer.setYLabelsPadding(10);

This work perfect for me. hope this help you.