Help to use Chart Customizer

Hello
I'm trying to use a Chart Customizer, most do not know how to use. I need to shrink the width of a bar report .
For this I created the class below.

What is the next step so I can apply this rule to my jasper report?

Thanks.

Code:
import org.jfree.chart.JFreeChart;
 
import org.jfree.chart.renderer.category.BarRenderer;
 
import net.sf.jasperreports.engine.JRChart;
 
import net.sf.jasperreports.engine.JRChartCustomizer;
 
 
 
 
 
public class BarChartCustomizer implements JRChartCustomizer {
 
 
 
	public void customize(JFreeChart chart, JRChart jasperChart) {
 
 
 
		BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
 
 
 
		renderer.setMaxBarWidth (0.1);
 
 
 
	}
 
 
 
}



Post Edited by vctlzac at 03/17/2011 01:58



Post Edited by vctlzac at 03/17/2011 01:59
vctlzac's picture
52
Joined: Jul 6 2010 - 5:08pm
Last seen: 10 years 5 months ago

1 Answer:

Hi,

Compile the BarChartCustomizer class and put it in the classpath. Then set the customizerClass attribute in the chart element:

<chart customizerClass="BarChartCustomizer">

..

</chart>

HTH,

sanda

shertage's picture
18770
Joined: Sep 26 2006 - 8:06pm
Last seen: 9 months 1 week ago
Feedback
randomness