Android中的Mpchartlib从饼图中删除切片文本

Android中的Mpchartlib从饼图中删除切片文本,第1张

概述HI .. 我使用https://github.com/PhilJay/MPAndroidChart在我的应用程序中显示饼图.我想隐藏图像中白色方块显示的部分. 我使用了以下代码.. mChart.setDescription(""); mChart.setDrawCenterText(true); mChart.setDrawHoleEnabled(false);

HI ..
我使用https://github.com/PhilJay/MPAndroidChart在我的应用程序中显示饼图.我想隐藏图像中白色方块显示的部分.

我使用了以下代码..

mChart.setDescription("");        mChart.setDrawCenterText(true);        mChart.setDrawHoleEnabled(false);        mChart.setRotationAngle(90);        mChart.setRotationEnabled(false);        mChart.settouchEnabled(false);        mChart.setCenterText(PTGConstantMethod.getNumberInTwoDigit((float) total));        mChart.setCenterTextTypeface(FontBold);        mChart.setCenterTextSize(getResources().getDimension(R.dimen.text_rate_circle_size));        mChart.setDrawHoleEnabled(true);        mChart.setDrawSliceText(false);        setChartData(aryVals,total);        mChart.animateXY(1000,1000);        mChart.getLegend().setEnabled(false);

我设置数据的方法是..

private voID setChartData(float[] values,double total) {    ArrayList<Entry> yVals = new ArrayList<Entry>();    for (int i = 0; i < values.length; i++) {        yVals.add(new Entry(values[i],i));    }    ArrayList<String> xVals = new ArrayList<String>();    for (int i = 0; i < values.length; i++) {        xVals.add("");    }    PIEDataSet set1 = new PIEDataSet(yVals,"");    set1.setSliceSpace(0);    ArrayList<Integer> colors = new ArrayList<Integer>();    colors.add(color.parsecolor("#d9534f"));    colors.add(color.parsecolor("#009a20"));    colors.add(color.parsecolor("#5bc0de"));    set1.setcolors(colors);    PIEData data = new PIEData(xVals,set1);    mChart.setData(data);    mChart.highlightValues(null);    mChart.invalIDate();}

有人可以帮我隐藏这些价值吗?谢谢你的帮助.

解决方法 要删除切片文本(来自x值数组),请调用:

pIEChart.setDrawSliceText(假)

总结

以上是内存溢出为你收集整理的Android中的Mpchartlib从饼图中删除切片文本全部内容,希望文章能够帮你解决Android中的Mpchartlib从饼图中删除切片文本所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1122412.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存