Jump to content

Bar Chart - Gap between Bars


pentaloc

Recommended Posts

Good Morning :)

 

I have a problem with my Bar Chart. As you can see on my attached file, the gap between the several Bars is

to small to get a good overview.

Can i change this gap with the chart customizer? Unfortunately i found nothing ;(

 

Thank you in advance! :)

pentaLoc

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Okay, after a bit more searching i found some pages about my problem.

 

http://mdahlman.wordpress.com/2011/04/17/chart-customizers-2/ :

Here i have to ad "" to my report. I added this tag at the beginning to the other properties but nothing happened.

http://community.jaspersoft.com/questions/512986/3d-bar-chart-scale-and-spaces-between-bars

Here is the solution a java class. But how can I add this code to the customizer class? Should I write this code into a java class and then copy this to the report?

Okay...you see i´m a newbie :D

Link to comment
Share on other sites

I have solved my problem after a long time of trying :D

 

For everyone who have the same problem and need some help here is my solution:

1. I wrote a java class with eclipse (see the code)

2. Exported this as a .jar file

3. Add this jar under options -> classpath

4. Change the propertie of the selected bar chart -> Customizer Class -> CustomizeBarChart

5. Finish

 

Solution for usage with jasperserver:

1. I have to replace the java folder in the jasperresports folder with the jdk i`m using with eclipse (okay, i could change

the java_home in the .bat files, but this dosen`t worked fine for me..)

2. Add the jar "CustomizeMe.jar" as resources to the report

3. If the customizer class is already added you are finished :)

 

I hope this helps someone and sorry for my bad english ;D

Code:
Link to comment
Share on other sites

  • 1 year later...

I followed all steps but when I start Jasper report, I'm getting this error:

 

Error filling print... org.jfree.chart.plot.XYPlot cannot be cast to org.jfree.chart.plot.CategoryPlot

java.lang.ClassCastException: org.jfree.chart.plot.XYPlot cannot be cast to org.jfree.chart.plot.CategoryPlot      at org.jfree.chart.JFreeChart.getCategoryPlot(JFreeChart.java:830)      at CustomizeBarChart1.customize(CustomizeBarChart1.java:12)      at net.sf.jasperreports.engine.fill.JRFillChart.evaluateChart(JRFillChart.java:1345)      at net.sf.jasperreports.engine.fill.JRFillChart.evaluateRenderer(JRFillChart.java:1305)      at net.sf.jasperreports.engine.fill.JRFillChart.evaluate(JRFillChart.java:1294)      at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258)      at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNoLastFooterSamePage(JRVerticalFiller.java:1065)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1030)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:300)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:134)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841)      at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:877)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 

Print not filled. Try to use an EmptyDataSource...

 

Link to comment
Share on other sites

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...