当前位置: 首页 > 工具软件 > PieChart > 使用案例 >

android piechart属性,安卓piechart百分之0数据怎么隐藏

许淳
2023-12-01

使用setCustom可以重设图例,而不被修改。

List lstLegendEntry = new ArrayList<>();

Legend.LegendForm form = legend.getForm();

float formSize = legend.getFormSize();

float formLineWidth = legend.getFormLineWidth();

DashPathEffect dashPathEffect =legend.getFormLineDashEffect();

lstLegendEntry.add(new LegendEntry(FAIL,form,formSize,formLineWidth

,dashPathEffect,Color.RED));

lstLegendEntry.add(new LegendEntry(PASS,form,formSize,formLineWidth

,dashPathEffect,Color.rgb(11, 157, 107)));

lstLegendEntry.add(new LegendEntry(DNF,form,formSize,formLineWidth

,dashPathEffect,Color.GRAY));

lstLegendEntry.add(new LegendEntry(CANCEL,form,formSize,formLineWidth

,dashPathEffect,Color.BLUE));

legend.setCustom(lstLegendEntry);

 类似资料: