Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android-MPChartLibrary “No Chart data available” Text size

I do not see any setter methods for the “No Chart data available” text. How do I make the Text larger / smaller?

like image 884
Mike6679 Avatar asked Nov 17 '25 12:11

Mike6679


2 Answers

In Chart class, one can see it's drawn via PAINT_INFO

First, retrieve the paint object, then style it as you want:

Paint paint = chart.getPaint(Chart.PAINT_INFO);
paint.setTextSize(yourSize);
like image 110
00seb Avatar answered Nov 19 '25 03:11

00seb


Textsize,textcolor,text message setting,use below code.

    Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "RockwellStd.otf");
    barChart.setNoDataText("Your message what you want to dispaly");
    Paint p = barChart.getPaint(Chart.PAINT_INFO);
    p.setTextSize(18);
    p.setColor(Color.parseColor("#701112"));
    p.setTypeface(tf);
like image 22
Sunisha Sindhu Avatar answered Nov 19 '25 03:11

Sunisha Sindhu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!