a bug

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply

a bug

Post by srikanth » Wed Aug 30, 2000 1:30 pm

i version 5.4 when all the values are same the barchart is not showing anything as it will be same as the x axis as the lowest y axis value is the same as the given value
and this makes it difficult

David Gilbert

RE: a bug

Post by David Gilbert » Wed Sep 06, 2000 4:21 am

Hi Srikanth,

Thanks for the feedback. I fixed this problem for the 0.6.0 release, but ran out of time to release the code before going on holiday. Unfortunately, I don't have access to the code at the moment, but when I get back I'll post the fix...



Andrew Porebski

RE: a bug

Post by Andrew Porebski » Fri Sep 22, 2000 8:17 pm

The problem occurs becuase the max and min values are the same
and they are both positive. Chart draws nothing for a series of just one
positive value either.

The fix I came up with is this:
for both VerticalNumberAxis and HorizontalNumberAxis modify autoAdjustRange method to include the check below

double upper = vvp.getMaximumVerticalDataValue().doubleValue();
double lower = vvp.getMinimumVerticalDataValue().doubleValue();

/** A. Porebski fixes min=max problem **/
if (upper == lower && lower > 0)
lower = 0.0;

Post Reply