Android-MPChartLibrary“无图表数据可用”文字大小

时间:2016-04-27 19:01:00

标签: android mpandroidchart

我没有看到“无图表数据可用”文本的任何setter方法。如何使文字变大/变小?

2 个答案:

答案 0 :(得分:2)

Chart课程中,可以看到它是通过PAINT_INFO绘制的

首先,检索绘制对象,然后根据需要设置样式:

Paint paint = chart.getPaint(Chart.PAINT_INFO);
paint.setTextSize(yourSize);

答案 1 :(得分:1)

Textsize,textcolor,短信设置,使用下面的代码。

    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);