本文介绍了如何使用Mikephil饼图从项目中删除小数位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是整数的静态值

  private int upload=14, bill=15, unbill=85, total=100, unupload=12, sign=10, unsign=90, print=12, unprint=88;

设置饼图条目

ArrayList<Entry> entries = new ArrayList<>();

entries.add(new Entry(bill, 0));
entries.add(new Entry(unbill, 1));
entries.add(new Entry(print, 2));
entries.add(new Entry(unprint, 3));
entries.add(new Entry(sign, 4));
entries.add(new Entry(unsign, 5));
entries.add(new Entry(upload, 6));
entries.add(new Entry(unupload, 7));

 int colors[] ={Color.rgb(84, 139, 221), Color.rgb(251, 249, 146),Color.rgb(151, 212, 153), Color.rgb(183, 144, 189),Color.rgb(226, 148, 188),Color.rgb(208, 189, 121),Color.rgb(185, 147, 134),Color.rgb(206, 139, 130)};

我在这里使用Mikephil PieChart,下面在数据集中添加了条目.

Here I am using Mikephil PieChart, below I added entries in dataset.

PieDataSet dataset = new PieDataSet(entries, "Graph");
dataset.setColors(colors);
dataset.setSliceSpace(3f);

我得到了这个输出.因此,我想删除我在

I am getting this output. So i want to remove decimal places which I mentioned in

输出是完美的.我只想要没有小数位的输出.我该怎么办?

Output is perfect. I just want output without decimal places. How can I do that?

推荐答案

如果可以输入整数值作为参数,或者如果库方法不接受整数值,则必须自定义库!

if you can input integer value as parameter you can or if the library method doesnt accepts integer value you have to customize the library !

这篇关于如何使用Mikephil饼图从项目中删除小数位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 04:35