rsreejithnair Posted May 27, 2009 Share Posted May 27, 2009 Hi All,How to control the width of a bar in a Bar/Stacked/3D Bar chart? If there is only one bar present in the chart, then its taking the whole width of the chart. Link to comment Share on other sites More sharing options...
kchaudhry Posted May 27, 2009 Share Posted May 27, 2009 You can write a custom class to define the width of the bars. Link to comment Share on other sites More sharing options...
rsreejithnair Posted May 28, 2009 Author Share Posted May 28, 2009 thanks for the reply... Could you tell me how to define a custom class and how to use it to control the bar width??? I am new to iReport.. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted May 28, 2009 Share Posted May 28, 2009 Hi, You can use JFreeChart Library for this purpose. The JasperReports distribution has a sample shipped that demonstrates how to develop a custom class to customize the graphs. DNV Srikanth. Link to comment Share on other sites More sharing options...
rsreejithnair Posted June 3, 2009 Author Share Posted June 3, 2009 Hi.. am using iReport version 2.0.5 can u help me how to do it in iReport??? Link to comment Share on other sites More sharing options...
alivelove2003 Posted November 24, 2010 Share Posted November 24, 2010 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 More sharing options...
cleitonesc3 Posted August 22, 2021 Share Posted August 22, 2021 can someone send me an example and explain me better how to set a larger width for my chart? 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