ntobik Posted July 25, 2006 Share Posted July 25, 2006 I have a few questions in regards to the chart tool functionality in iReport. 1. On a bar chart, is there any way to make the category text labels angled at the bottom? Currently my dates are cut off with a ..., I'd like them to be at a 45 deg angle if possible so everything will be visible. 2. Is there any way to specify specific colors for the charts? I need all my charts to use the same colors throughout the reports so it's consistent. 3. How do you use a customizer class within the chart tool? I have the manual and it mentions it briefly, but I'd like more details or a simple example if possible. Thank you. Nate Link to comment Share on other sites More sharing options...
ntobik Posted July 26, 2006 Author Share Posted July 26, 2006 I ended up solving all of my problems and I thought I should share with everyone else how I did it. JRChartCustomizer... You implement that interface and it gives you access to the JFreeChart object, you can modify the object to your hearts content and all of the changes will be rendered in with the report. Let me know if anyone runs into any problems. Link to comment Share on other sites More sharing options...
wahoyaho Posted August 3, 2006 Share Posted August 3, 2006 Hi, sorry I'm kind of new to this, could you explain in greater detail how I can implement JRChartCustomizer and modify the existing chart? Thanks. Link to comment Share on other sites More sharing options...
zmanning Posted August 4, 2007 Share Posted August 4, 2007 Code:public class FirstCustomizer implements JRChartCustomizer { public void customize(JFreeChart chart, JRChart jasperChart) { BarRenderer renderer = (BarRenderer) chart.getCategoryPlot() .getRenderer(); CategoryPlot plot = chart.getCategoryPlot(); CategoryAxis cata = plot.getDomainAxis(); The code above should be a good starting point. Specify the full name of this class as the customizer class. Link to comment Share on other sites More sharing options...
ooober Posted December 2, 2008 Share Posted December 2, 2008 hi 1. you can rotate your label by setting the Label rotation to -25 in Chart Property. 2. You can change your mutiple bar color by adding series of color in Series Color of Chart property Hasham Habib Link to comment Share on other sites More sharing options...
mdahlman Posted December 2, 2008 Share Posted December 2, 2008 You can find examples of reports that use chart customizers in the SuperMart samples that ship with JasperServer Pro. Downloading that will perhaps be the quickest way to get started. Regards,MattJaspersoft Link to comment Share on other sites More sharing options...
arcioneo Posted January 22, 2009 Share Posted January 22, 2009 I'm trying to do the same(taking about rotation label), but no matter what number I choose, does nothing and the chart looks in the same way Link to comment Share on other sites More sharing options...
ashwini Posted July 15, 2009 Share Posted July 15, 2009 Hi This is Amit. Can u tell me how to give path of the JRChartCustomizer class in the chart tool properties (Customizer Class). I found error as ErrorÂfillingÂprint...ÂCouldÂnotÂcreateÂchartÂcustomizerÂinstance. net.sf.jasperreports.engine.JRRuntimeException:ÂCouldÂnotÂcreateÂchartÂcustomizerÂinstance. ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillChart.<init>(JRFillChart.java:326) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillObjectFactory.getChart(JRFillObjectFactory.java:582) ÂÂÂÂatÂnet.sf.jasperreports.engine.base.JRBaseChart.getCopy(JRBaseChart.java:552) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillElementGroup.<init>(JRFillElementGroup.java:88) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillElementContainer.<init>(JRFillElementContainer.java:90) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillBand.<init>(JRFillBand.java:83) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillObjectFactory.getBand(JRFillObjectFactory.java:385) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:432) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:59) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:57) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234) ÂÂÂÂatÂit.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:934) ÂÂÂÂatÂjava.lang.Thread.run(UnknownÂSource) CausedÂby:Âjava.lang.ClassNotFoundException:Âtest ÂÂÂÂatÂjava.net.URLClassLoader$1.run(UnknownÂSource) ÂÂÂÂatÂjava.security.AccessController.doPrivileged(NativeÂMethod) ÂÂÂÂatÂjava.net.URLClassLoader.findClass(UnknownÂSource) ÂÂÂÂatÂjava.lang.ClassLoader.loadClass(UnknownÂSource) ÂÂÂÂatÂsun.misc.Launcher$AppClassLoader.loadClass(UnknownÂSource) ÂÂÂÂatÂjava.lang.ClassLoader.loadClass(UnknownÂSource) ÂÂÂÂatÂjava.lang.ClassLoader.loadClassInternal(UnknownÂSource) ÂÂÂÂatÂjava.lang.Class.forName0(NativeÂMethod) ÂÂÂÂatÂjava.lang.Class.forName(UnknownÂSource) ÂÂÂÂatÂnet.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:132) ÂÂÂÂatÂnet.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:72) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillChart.<init>(JRFillChart.java:323) ÂÂÂÂ...Â15Âmore Link to comment Share on other sites More sharing options...
wnasich Posted May 24, 2012 Share Posted May 24, 2012 New solution:See labelRotation> http://jasperreports.sourceforge.net/schema.reference.html#plot_labelRotationUsage: Edit in xml mode, and add the "plot" tag with labelRotation attribute. Example: Code: 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