Expand bars in a BarChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
PhilDeFer
Posts: 6
Joined: Sat Mar 07, 2009 1:12 am

Expand bars in a BarChart

Post by PhilDeFer » Sun Apr 05, 2009 11:06 pm

Hi, I want to have my bars expanded when displayed on a bar chart.

Here is what I want to get (obtained using a StackedBarChart) :

Image

Here is what Im getting with the BarChart :

Image

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Expand bars in a BarChart

Post by david.gilbert » Mon Apr 06, 2009 8:05 am

You have 3 series and 3 categories in your dataset - nine items in total. Six of your dataset items have null values and the renderer is leaving space for those. You have two options:

(1) Write a custom renderer that ignores null values and doesn't allocate any space for them;

(2) Populate your dataset so that it has just one series with three items.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

PhilDeFer
Posts: 6
Joined: Sat Mar 07, 2009 1:12 am

Re: Expand bars in a BarChart

Post by PhilDeFer » Mon Apr 06, 2009 9:54 am

This helped a lot !

Thank you !

Locked