Jump to content
Changes to the Jaspersoft community edition download ×

Cylindrical bars in bar charts


mkhan523

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

For cylinder bars a cylinder renderer is needed. There is a CylinderRenderer class in the JFreeChart demo jar that can be used instead of the usual BarRenderer3D. You will need to add the demo jar to the app classpath. More on getting the demo jar you can find out on the JFreeChart site.
Next, use a chart customizer to get access to the JFreeChart object.
In the customize() method, replace the BarRenderer3D object in the category plot with a CylinderRenderer.
 
For further issues or howtos related on the CylinderRenderer class, the JFreeChart forum is the best place to ask questions.

Hope this helps,
sanda

Code:
public void customize(JFreeChart chart, JRChart jasperChart){  CylinderRenderer cylinderRenderer= new CylinderRenderer();  CategoryPlot categoryPlot = (CategoryPlot)chart.getPlot();  BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();  // set all needed renderer properties here; for instance:  // cylinderRenderer.setItemMargin(barRenderer3D.getItemMargin());  // etc  categoryPlot.setRenderer(cylinderRenderer);}
Link to comment
Share on other sites

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...