Question

I am using Bar chart component from https://code.google.com/p/achartengine/ and I want just to increase the text size of labels which appear above the chart

enter image description here

I mean I want to make numbers (4,5) bigger that now

I tried the following code :

renderer.setAxisTitleTextSize(24);
renderer.setChartTitleTextSize(24);
renderer.setLabelsTextSize(24);
renderer.setLegendTextSize(24);

but I didn't get any difference

What should I do to achieve that ?

Was it helpful?

Solution

This line r.setChartValuesTextSize(24); solve the problem

The complete code :

protected XYMultipleSeriesRenderer buildBarRenderer(int[] colors) {
        XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
        renderer.setAxisTitleTextSize(24);
        renderer.setChartTitleTextSize(24);
        renderer.setLabelsTextSize(24);
        renderer.setLegendTextSize(24);
        int length = colors.length;
        for (int i = 0; i < length; i++) {
            XYSeriesRenderer r = new XYSeriesRenderer();
            r.setLineWidth(24);
            r.setColor(colors[i]);
// here is the magic
            r.setChartValuesTextSize(24);
            renderer.addSeriesRenderer(r);
        }
        return renderer;
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top