Ajay B
Ajay B

Reputation: 776

How to increase size of text value on top of MPAndroid Bar Chart?

I have created a chart using MPAndroid Chart. I want to know how can I increase the size of text value on top of each bar in MPAndroid Bar Chart? Which API should I use? I have circled the value in the attached picture in Red circle

enter image description here

Upvotes: 2

Views: 2747

Answers (2)

AMAN SINGH
AMAN SINGH

Reputation: 3561

you can try it by using

barDataset.setValueTextSize(12f);

where barDataset is BarDataSet

Upvotes: 7

Ajay B
Ajay B

Reputation: 776

I was able to find the answer to my question after some trials. This is the code to set the font size of left and right Y-axis on a MPAndroidChart

    import com.github.mikephil.charting.charts.CombinedChart;

 //Code snippet



      CombinedChart combinedChart = (CombinedChart) findViewById(R.id.chart);
      YAxis yaLeft = combinedChart.getAxisLeft();
      YAxis yaRight = combinedChart.getAxisRight();
      yaLeft.setTextSize(14/*textSize*/);
      yaRight.setTextSize(14/*textSize*/);

Upvotes: 0

Related Questions