如何更改 MPAndroidChart PieChart 上的描述文字大小”?

How to change description text size on MPAndroidChart PieChart"?

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

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.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 

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

描述: 是 getDescription() 从图表返回的对象。