Grouped bar chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mskjeret
Posts: 27
Joined: Sun May 23, 2004 8:58 am

Grouped bar chart

Post by mskjeret » Thu Aug 31, 2006 8:08 pm

Hi

I have been looking around the source code, but without success so far.

I want to do something like the StackedBarChartDemo4, but with "normal" bars and not stacked.

Is this possible?

Magne Skjeret

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Fri Sep 01, 2006 7:29 am

I think you are referring to the "grouped" feature. In JfreeChart there is the BarRenderer, the StackedBarRenderer and the GroupedStackedBarRenderer but no GroupedBarRenderer.

Anyway, I think it is possible to achive what you want also with the GroupedStackedBarRenderer.

mskjeret
Posts: 27
Joined: Sun May 23, 2004 8:58 am

Post by mskjeret » Fri Sep 01, 2006 9:38 am

Is the solution you think of having one item on each stacked bar? One item that takes 100% of the bar. I assume that could be done.

Do you, or anyone, know why there is no GroupedBarRenderer?
Any technical reasons, or just haven't been done yet?

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Fri Sep 01, 2006 1:27 pm

mskjeret wrote:Is the solution you think of having one item on each stacked bar? One item that takes 100% of the bar. I assume that could be done.
I think about having only one item in a series.
mskjeret wrote: Do you, or anyone, know why there is no GroupedBarRenderer?
Any technical reasons, or just haven't been done yet?
I suppose, just haven't been done yet.

mskjeret
Posts: 27
Joined: Sun May 23, 2004 8:58 am

Post by mskjeret » Fri Sep 01, 2006 7:11 pm

It seems that I don't need a grouped bar renderer afterall.

Adding a SubCategory axis to the plot does exactly what I need to do.
I also need to set a fixed legend, like in the grouped stack demo4, to avoid the large legend that would otherwise be added.

Maybe that explains why there is no renderer implementation available?

I am however having some problems setting the category label position. If I set it on the SubCategory it seems to only be applied to the category labels already in the plot.

Magne

Locked