Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何更改MPAndroidChart PieChart“上的说明文字大小?”;?_Java_Android_Pie Chart_Mpandroidchart - Fatal编程技术网

Java 如何更改MPAndroidChart PieChart“上的说明文字大小?”;?

Java 如何更改MPAndroidChart PieChart“上的说明文字大小?”;?,java,android,pie-chart,mpandroidchart,Java,Android,Pie Chart,Mpandroidchart,我通过实现PieChart对库进行了以下设置,但我需要设置描述文本大小 PieData data = new PieData(valsPieX, set1); data.setValueTextSize(20f); if(usePercentSymbol) data.setValueFormatter(new PercentFormatter()); pieChart.setData(data); pieChart.setDrawSliceTex

我通过实现PieChart对库进行了以下设置,但我需要设置描述文本大小

PieData data = new PieData(valsPieX, set1);
    data.setValueTextSize(20f);
    if(usePercentSymbol)
        data.setValueFormatter(new PercentFormatter());

    pieChart.setData(data);
    pieChart.setDrawSliceText(false);
    *pieChart.setDescription(Description);*
    pieChart.highlightValues(null);
    pieChart.invalidate();

pieChart.getDescription().setTextSize(16f);

pieChart:是您的图表对象,它可以是
pieChart
BarChart
LineChart
或任何其他图表类型

Description:是由图表中的
getDescription()
返回的对象。

将您的问题改为“关于MPAndroidChart PieChart”,您将获得更多点击。从审阅队列:我可以请求您在源代码周围添加一些上下文吗。只有代码的答案很难理解。如果你能在你的文章中添加更多的信息,这将有助于询问者和未来的读者。
pieChart.getDescription().setText("Description Text goes here"); //the text which will be displayed. 

pieChart.getDescription().setTextSize(16f); //sets the size of the label text in density pixels min = 6f, max = 24f, default is 10f, font size will be in dp

pieChart.getDescription().setTextColor(ContextCompat.getColor(context, android.R.color.holo_red_dark)); //the color of the font 


pieChart.getDescription().setTextAlign(Paint.Align.RIGHT); //Sets the text alignment of the description text. Default RIGHT