1

I want to customised my charts in my reports (using jasperReport and iReport 4.0) ,this class minimise the scale ,how can I also add value on top of each bar and write the properity on X axis vertically because their are overlapping (look at the attach chart it's a mess)?

this is the class:

public class ChartCustomiser implements JRChartCustomizer{

 @Override
 public void customize(JFreeChart jfc, JRChart jrc) {

  CategoryPlot plot = (CategoryPlot)jfc.getPlot();
  ValueAxis verticalAxis = plot.getRangeAxis();
  TickUnits verticalTicks = new TickUnits();
  verticalTicks.add(new NumberTickUnit(1));
  verticalTicks.add(new NumberTickUnit(2));
  verticalTicks.add(new NumberTickUnit(5));
  verticalTicks.add(new NumberTickUnit(10));
  verticalAxis.setStandardTickUnits(verticalTicks); 
  throw new UnsupportedOperationException("Not supported yet.");
 }
}

enter image description here

I want a chart look like this:

enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
rym
  • 545
  • 6
  • 12
  • 36
  • Why not [`extends JRAbstractChartCustomizer`](http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRAbstractChartCustomizer.html)? – trashgod Aug 24 '11 at 10:52

1 Answers1

1

you can try this:

NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis();
rangeAxis.setVerticalTickLabels(true);
lkdg
  • 1,031
  • 7
  • 18
  • +1 This should work; here's a related [example](http://stackoverflow.com/questions/5522575/how-can-i-update-a-jfreecharts-appearance-after-its-been-made-visible). – trashgod Aug 25 '11 at 01:25
  • @lkdg,thank you for the reply ,but I want to write the value on X Axis verticaly not the Y Axis I will update my post with a picture describe what I want – rym Aug 25 '11 at 09:36