How to display two decimal values in percentage of a normal pie chart in Products Posted June 18, 2015 I already implemented the chart customizer suggested in this question: http://community.jaspersoft.com/questions/539659/how-show-percentage-decimal-value-pie-chartI adapted it to use a normal pie chart: import net.sf.jasperreports.engine.JRChart;import net.sf.jasperreports.engine.JRChartCustomizer;import org.jfree.chart.JFreeChart;import org.jfree.chart.labels.StandardPieSectionLabelGenerator;import org.jfree.chart.plot.PiePlot;public class PiePercentageCustomizer implements JRChartCustomizer{ @Override public void customize(JFreeChart jFreeChart, JRChart jrChart) { PiePlot piePlot = (PiePlot) jFreeChart.getPlot(); ((StandardPieSectionLabelGenerator)piePlot.getLabelGenerator()).getPercentFormat().setMaximumFractionDigits(2); } }[/code]I generate a jar file and added it to my application classpath.The problem is when I render my report I get the following exception: Classjava.lang.ClassCastExceptionMessagenet.sf.jasperreports.charts.util.PieLabelGenerator cannot be cast to org.jfree.chart.labels.StandardPieSectionLabelGeneratorMy application is a grails 2.3.11 project using the jasper plugin 1.11.0Any help will be appreciated
Error in Products Posted May 28, 2015 Facing the same error too.The error is raised only when I deploy the report into a grails application running on tomcat server, in development environment works fine.
How to display two decimal values in percentage of a normal pie chart
in Products
Posted
I already implemented the chart customizer suggested in this question: http://community.jaspersoft.com/questions/539659/how-show-percentage-decimal-value-pie-chart
I adapted it to use a normal pie chart:
I generate a jar file and added it to my application classpath.
The problem is when I render my report I get the following exception:
My application is a grails 2.3.11 project using the jasper plugin 1.11.0
Any help will be appreciated