Does anyone know how to remove the box/border around label in jasperreport piechart? What do I need to include in the .jrxml file so that the label displayed with no border.
Asked
Active
Viewed 1,897 times
2
-
Are you asking about simple pie-chart or about highcharts? – Alex K Dec 12 '16 at 20:30
-
This is pie3DChart – lilylove2shop Dec 13 '16 at 21:16
1 Answers
4
Add a JRChartCustomizer
, setting labelOutlinePaint
and labelShadowPaint
to null
in plot
Example
Java customizer
public class NoLabelCustomizer implements JRChartCustomizer{
@Override
public void customize(JFreeChart chart, JRChart jrchart) {
PiePlot plot = (PiePlot) chart.getPlot();
plot.setLabelOutlinePaint(null);
plot.setLabelShadowPaint(null);
}
}
jrxml
<pie3DChart>
<chart isShowLegend="false" customizerClass="NoLabelCustomizer">
<reportElement mode="Opaque" x="225" y="0" width="320" height="140" backcolor="#FFFFFF" uuid="23bd26a6-04a4-406f-8a1a-5e1b260cb75d"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
<anchorNameExpression><![CDATA["Graph"]]></anchorNameExpression>
<hyperlinkTooltipExpression><![CDATA["Graph"]]></hyperlinkTooltipExpression>
</chart>
<pieDataset>
<keyExpression><![CDATA[$F{User}]]></keyExpression>
<valueExpression><![CDATA[$F{Rep}]]></valueExpression>
</pieDataset>
<pie3DPlot isShowLabels="true">
<plot/>
<itemLabel/>
</pie3DPlot>
</pie3DChart>
Note the
customizerClass="NoLabelCustomizer"
on the chart tag
Output (using datasource from this question)

Community
- 1
- 1

Petter Friberg
- 21,252
- 9
- 60
- 109