Alignment of Category Axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mkrumpak
Posts: 3
Joined: Sat Oct 14, 2006 3:31 pm

Alignment of Category Axis

Post by mkrumpak » Thu Dec 28, 2006 7:33 pm

Hi,

I've searched through postings, but could not find this issue addressed. I am sure it impacts many charts.

I have a simple bar chart with four bars that works great when at least one of the four bars has a non zero value. When all four bars are zero, the vertical alignment of the category axis changes.

It appears that the category axis gets centered within the plot area instead of aligned to the bottom of the plot area as usual. Is there a setting that would prevent this?

Morwen
Posts: 26
Joined: Sat Apr 02, 2005 6:26 pm

Post by Morwen » Tue Jan 02, 2007 4:11 pm

Yes, happens to me too. Encountered it on numerous occassions. Would have liked it to get fixed as well :)

Best wishes,

Morwen.

mkrumpak
Posts: 3
Joined: Sat Oct 14, 2006 3:31 pm

Post by mkrumpak » Thu Jan 04, 2007 4:09 pm

The workaround that I am currently using tests for rangeAxis.getUpperBound setting. For some reason the setting is 5.0E-9 when only zeros are in the recordset.

Can anyone confirm the 5.0E-9 setting for "zero only" recordsets?

Anyway, here's the check with manual reset of the upper bound that does the trick in my case.

if (rangeAxis.getUpperBound() == 5.0E-9) {
rangeAxis.setUpperBound(2.0);
}

Locked