Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase font size of bottom bar MPAndroidChart

I have a MPAndroidChart BarChart and I have looked through the javadoc and online documentation but am unable to find a way to increase the size of the text at the bottom of the chart.

Here is an image which shows the chart and the font at the bottom left which is too small to view properly on this higher resolution tablet. Is there a way to increase this font size?

Tablet Screen

Note: I recognize that increasing the axis label size is done with:

chart.getXAxis().setTextSize(20);

Edit: I have searched online at a variety of topics and looked through the MPAndroidChart github project but have been unable to find code to make this change. I have been able to change all the other font sizes so can only assume this must also be possible.

like image 305
JFreeman Avatar asked Sep 17 '25 20:09

JFreeman


1 Answers

Okay so I found the answer in the MPandroidchart documentation:

First load the legend:

    Legend l = pieChart.getLegend();

Then you can modify the legends properties such as the text size,color, or the shape of the objects in your legend:

    l.setTextSize(20f);
    l.setTextColor(Color.BLACK);
    l.setForm(Legend.LegendForm.CIRCLE);
like image 128
JFreeman Avatar answered Sep 19 '25 10:09

JFreeman