I am trying to use the customizer class BarRenderer from jFree charts to customize a bar chart, I have added the jar to the classpath and added the class to the customizer class section of the Bar Chart properties as org.jfree.chart.renderer.category.BarRenderer and I keep getting the error:
net.sf.jasperreports.engine.JRRuntimeException: Could not create chart customizer instance.
Caused by: java.lang.ClassCastException: org.jfree.chart.renderer.category.BarRenderer cannot be cast to net.sf.jasperreports.engine.JRChartCustomizer
Is there something I am missing or forgot to do here, any help to get this running would be much appreciated
A customizer and a renderer are two different animals: the renderer is responsible for painting a part of the chart while the customizer lets you customize it.
What you need to do is create a class that extends
JRChartCustomizerand in the customize method set theBarRenderer:Then in your design you need to set the customizer to
MyCustomizerand make sure that your class is in the classpath