- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用“implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'”这个库来创建饼图,并且我手动输入的饼图条目值显示不正确。我按照教程进行操作,教程中的结果也是如此,没有出现正确的值。
PieChart pieChart=findViewById(R.id.pieChart);
pieChart.setUsePercentValues(true);
pieChart.getDescription().setEnabled(false);
pieChart.setExtraOffsets(5,10,5,10);
pieChart.setDragDecelerationFrictionCoef(0.95f); //how smooth it should spin
pieChart.setDrawHoleEnabled(true);
pieChart.setHoleColor(Color.WHITE);
pieChart.setTransparentCircleRadius(60f);
List<PieEntry> value=new ArrayList<>();
value.add(new PieEntry(23.2f,"value1");
value.add(new PieEntry(92.2f,"value2");
value.add(new PieEntry(12.3f,"value3");
PieDataSet pieDataSet= new PieDataSet(value,"Months");
pieDataSet.setSliceSpace(3f); //between the slice spaces
pieDataSet.setSelectionShift(5f);
pieDataSet.setColors(ColorTemplate.MATERIAL_COLORS); //for variety of colors
PieData pieData=new PieData(pieDataSet);
pieData.setValueTextSize(10f);
pieData.setValueTextColors(Collections.singletonList(Color.WHITE));
pieChart.animateXY(1400,1400);
pieChart.setData(pieData);
23.2f 显示为 18.2,92.2f 显示为 72.2,12.3 显示为 9.6为什么这些值不像我提到的那样出现?
最佳答案
它显示饼图的百分比值。
请使其为假以显示真实值(value)。像下面这样
pieChart.setUsePercentValues(false);
关于java - MPAndroidChart 值没有像我提到的那样出现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59657886/
client.on('message', message => { if (message.content === `L!hug`) { if (!message.menti
我往往会忘记我 stash 了一些更改。当存储空间不为空时,我希望看到 git status 输出中提到的存储空间。有没有办法让 git status 这样做? 最佳答案 This is now a
[object Object] 是 JavaScript 对象的默认字符串表示。 如果只是 [Object] 或 [object] 我会理解,但为什么是 [object Object]?为什么第一个单
Jython 可以在这里提供帮助吗?我应该在 Jython 之上运行 Grails,如果是,如何运行?不知何故,我应该能够在同一个 JVM 上运行 Grails 和 Python 脚本。还有其他可能性
http://download.oracle.com/javase/tutorial/collections/interfaces/set.html 为什么Set接口(interface)会列出Col
我正在使用 keras 编写一个 ner 模型,并将模型部署到tensorflow-serving。然后使用http请求来获取预测结果。 这是我的代码: EMBEDDING_OUT_DIM = 128
我是一名优秀的程序员,十分优秀!