| Auszug |
|---|
|
Nuclos Jasper pie chart: value label key, label format, pie3DPlot, piePlot, customizer, PiePlot, setLabelFont. |
Language: Deutsch · English
Pie chart
Pie charts in JasperReports – data binding (value/label/key) and three ways of formatting including a customizer class.
| Status |
|---|
| colour | Blue |
|---|
| title | Application developer |
|---|
|
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
Create a pie chart
- Drag the chart element from the palette onto the canvas – the selection dialog opens.
- Choose Pie Chart or Pie3D Chart and configure via Next or create immediately with Finish.

Pie chart selection in the wizard.
Data binding
| Field | Meaning |
|---|
| Value | numeric value of the segment (e.g. order total). |
| Label | label of the shares (value or key). |
| Key | key/grouping (equals GROUP BY) – shown in the legend. |
| Reset on | usually Report. |
| Codeblock |
|---|
|
{0} text only
{1} with number
{2} percentage |
2. Font & size in the XML
Applies to pie3DPlot and piePlot:
| Codeblock |
|---|
|
<pie3DPlot depthFactor="0.1" isCircular="true" labelFormat="{0} {2}" legendLabelFormat="">
<plot/>
<itemLabel>
</itemLabel>
</pie3DPlot> |
3. Custom customizer class
| Codeblock |
|---|
|
package org.axismanipulation;
import java.awt.Color;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot;
import net.sf.jasperreports.engine.JRAbstractChartCustomizer;
import net.sf.jasperreports.engine.JRChart;
import java.awt.Font;
public class PieManipulation extends JRAbstractChartCustomizer{
@Override
public void customize(JFreeChart chart, JRChart jasperChart) {
PiePlot plot = (PiePlot)chart.getPlot();
plot.setInteriorGap(0.02);
plot.setMaximumLabelWidth(0.20);
plot.setBackgroundPaint(Color.white);
Font font = new Font("Calibri", Font.PLAIN, 7);
plot.setLabelFont(font);
plot.setCircular(true);
}
} |
Related pages
Charts in the designer
Charts.
Open →