Java 如何更改MPAndroidChart PieChart“上的说明文字大小?”;?
我通过实现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
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