【发布时间】:2014-06-30 22:08:55
【问题描述】:
我使用 android plot pie chart 在我的应用程序中绘制数据。我的问题是饼图中的分隔线(如下图所示)。无论我如何设置图表,我似乎都无法摆脱黑线。
我是这样设置的:
//Sets up the pie chart to display the user beer ratings figures visually
private void chartSetup(PieChart p){
PieWidget pw = p.getPieWidget();
pw.setPadding(0,0,0,0);
SegmentFormatter sf1 = new SegmentFormatter();
sf1.configure(getActivity(),R.xml.pie_segment_formatter1);
sf1.getFillPaint();
SegmentFormatter sf2 = new SegmentFormatter();
sf2.configure(getActivity(), R.xml.pie_segment_formatter2);
sf2.getFillPaint();
Segment monthly = new Segment("", totalBeerCount);
Segment total = new Segment("", monthlyBeerCount);
p.setPlotMarginBottom(0);
p.addSegment(monthly, sf1);
p.addSegment(total, sf2);
p.redraw();
p.getBorderPaint().setColor(Color.TRANSPARENT);
p.getBackgroundPaint().setColor(Color.TRANSPARENT);
p.getRenderer(PieRenderer.class).setDonutSize(.90f, PieRenderer.DonutMode.PERCENT);
}
这是两个段格式化程序 xml 文件:
pie_segment_formatter1
<?xml version="1.0" encoding="utf-8"?>
<config
fillPaint.color="@color/appRed"
labelPaint.textSize="5dp"
innerEdgePaint.color = "@color/appRed"
outerEdgePaint.color = "@color/appRed"/>
pie_segment_formatter2
<?xml version="1.0" encoding="utf-8"?>
<config
fillPaint.color="@color/lightGrey"
labelPaint.textSize="5dp"
innerEdgePaint.color = "@color/lightGrey"
outerEdgePaint.color = "@color/lightGrey"/>
我已经尝试在配置文件中包含linePaint.strokeWidth="0dp",但这并没有任何区别。如果有人能在这方面帮助我,我将不胜感激。
【问题讨论】:
标签: android charts pie-chart androidplot