sct999.1 Posted June 18, 2015 Share 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 Link to comment Share on other sites More sharing options...
rajesh.sirsikar Posted June 23, 2015 Share Posted June 23, 2015 Hi sct999.1I have resolved your specific issue in my below blog. Please check the samehttp://www.rajeshsirsikar.com/display-value-of-each-slice-inside-pie-chart-slices-jaspersoft-studio/Thanks,Rajesh S Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now