Category bar chart with 2 axis...

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Juggle4Evr
Posts: 7
Joined: Wed Jul 20, 2005 7:30 am
Location: Munich, Germany

Category bar chart with 2 axis...

Post by Juggle4Evr » Wed Feb 15, 2012 9:28 am

Hi,

for a very long time I have a problem with bar charts. I always worked around it but now I'm sick of it and looking for a better solution.

The category bar chart I have has one domain axis and 2 range axis. There are two datasets, each with several series of data. Each dataset is mapped to one range axis.
As long as both datasets have the same categories in the same sort order, everthing is relatively fine. The bars are where they belong (but they overlap each other wich is not nice). But if in the second dataset, categories are missing or in another order, the bars don't correlate with the domain axis (and the bars of the first dataset). I tried to explicitly map the second dataset to the domain axis but it didn't help.
Any ideas how to fix this? I worked around that inserting dummy data into the second dataset but that stinks.

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Category bar chart with 2 axis...

Post by paradoxoff » Wed Feb 15, 2012 2:13 pm

I once had a similar issue: though the column keys of my various CategoryDatasets were the same in number and order, the bars for the various dataset overlapped.
I then tried to find a clean solution for this, i.e. make the CategoryPLot to automatically recognize this and behave in a proper way, but found that too complicated. Too many informations concerning the series and category keys for all datasets would have to be provided at too many stages of the rendering. Finally, I ended up with using dummy data as well, which was IMHO a handy solution.
So I advise to continue your dummy data baseds solution, though it may stink.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Category bar chart with 2 axis...

Post by matinh » Wed Feb 15, 2012 2:36 pm

Hi!

If you create a Bug-Tracker Entry the chance that this will get fixed is even better.
If you do so, please provide a demo-programm that demonstrates the bug and eventually a screenshot.
Also linkt to this forum post.

thanks,
- martin

Juggle4Evr
Posts: 7
Joined: Wed Jul 20, 2005 7:30 am
Location: Munich, Germany

Re: Category bar chart with 2 axis...

Post by Juggle4Evr » Wed Feb 15, 2012 2:50 pm

I'm not sure this is really a bug. Could also be caused by the concept how data is organized to display the chart. Main cause I think is that axis are mapped to datasets and not to series.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Category bar chart with 2 axis...

Post by matinh » Wed Feb 15, 2012 3:04 pm

I'm not sure this is really a bug.
In this case it should be discussed in the forum first.

However, if you don't get a satisfying answer and still want it to be considered, you could file a feature request. This way it won't at least be forgotten.

That said, I'm not going to have a closer look at it now (lack of time), but a small self-contained demo whould definitely help!

hth,
- martin

Juggle4Evr
Posts: 7
Joined: Wed Jul 20, 2005 7:30 am
Location: Munich, Germany

Re: Category bar chart with 2 axis...

Post by Juggle4Evr » Wed Feb 15, 2012 3:11 pm

Oh, in the meantime I added a bug tracker entry with a little demo:
https://sourceforge.net/tracker/?func=d ... tid=115494

Locked