Is a combined BarChart and StackedBarChart possible?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
toblix
Posts: 5
Joined: Sat Jun 30, 2007 12:25 am

Is a combined BarChart and StackedBarChart possible?

Post by toblix » Sat Jun 30, 2007 12:32 am

Hi. Is it possible to have a chart like this?

(I tried inserting an image here, but no.) What I'm thinking of is a chart with two bars, side by side, for each month or whatever. One of the bars should be a stacked bar, the other not.

I can attach a bar renderer to a stacked bar chart, but I can't position them side by side like that. Is it even possible?

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

Post by david.gilbert » Mon Jul 02, 2007 6:51 am

Perhaps you can use the GroupedStackedBarRenderer, and define the groups so that one has only a single series in it?
David Gilbert
JFreeChart Project Leader

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

toblix
Posts: 5
Joined: Sat Jun 30, 2007 12:25 am

Post by toblix » Mon Jul 02, 2007 7:30 am

Hey, thanks. That seems to be what I'm looking for. However, for this to work, I need to be able to associate one group to a different domain axis. Is this possible?

toblix
Posts: 5
Joined: Sat Jun 30, 2007 12:25 am

Post by toblix » Tue Jul 03, 2007 11:01 am

It seems I have to solve this by having two GroupedStackedBarRenderers, one mapped to each axis, and then cheating by giving the first one an "empty" first category and the second an "empty" second category, or something like that?

rcdjbp
Posts: 6
Joined: Thu Jul 26, 2007 4:43 pm

Combined + Stacked

Post by rcdjbp » Mon Aug 13, 2007 7:13 pm

Hi toblix,

Did you get this to work? I have been trying to do the same thing without success.

Thanks, Jabe
rcdjbp@yahoo.com

Locked