Jump to content

Width of bars in a bar chart.


rsreejithnair

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 year later...

 While using iReport, if we select the chart and view the properties window, we can find  a property named Customizer Class.

So we can give a class name here but that class must implement net.sf.jasperreports.engine.JRChartCustomizer interface (better to include all relevant jfree chart and jasperreport jars). 

The interface has one method,

public void customize(JFreeChart chart, JRChart jasperChart) which we have to implement. In this method we get a reference to the JFreeChart instance which we can use to obtain its CategoryPlot instance. Thru CategoryPlot instance we can obtain a CategoryItemRenderer instance. Then we can cast this CategoryItemRenderer instance to BarRenderer instance.  BarRenderer instance has a method to set the maximum width of the bar chart. So dive into the JFree API.  :-)

Link to comment
Share on other sites

  • 10 years 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...