I am using iReport and JasperReports, both in v4.7.
I want to show the percentage of each slice in the label. Something like "Option 1 (45.67%)".
After reading many sites I came to the following snippet.
<piePlot labelFormat="{0} ({2})" legendLabelFormat="{0} ({2})">
<plot/>
<itemLabel/>
</piePlot>
According to the documentation of iReport.
- {0} item name
- {1} value
- {2} percentage
However, when I run the report on iReport or JasperReports I get only the percentage in the legend area (legendLabelFormat) not in label (labelFormat) of each slice and, also, the percentage is show as an integer not as a float.
Somebody knows how to show the percentage in the label and -if possible- with decimal values?