a fixed error . To David Gilbert

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Miguel Zabaraín

a fixed error . To David Gilbert

Post by Miguel Zabaraín » Sat Aug 05, 2000 2:20 am

Hi David, It's me again...

This is just to tell You about what I Think is an error in The VerticalNumberAxis Class. I find two errors in the second constructor of the class.

The first one is that You don't parse the values to the super class, and the second one is about a no valid number of arguments (just because You duplicate a boolean parameter.

Following is the fixed code, with the errors in /* */ comments operators.


public VerticalNumberAxis(Plot plot, String label, Font labelFont, Number min, Number max) {

/*this*/super(plot, label, labelFont, Color.black, new Insets(4, 4, 4, 4), true,

/* true,*/ new Font("Arial", Font.PLAIN, 10), Color.black, new

Insets(2, 1, 2, 1),
true, new BasicStroke(1), false, min, max,
true, new Double(5.0),
new DecimalFormat("0"),
false, new BasicStroke(1), Color.lightGray);

}



By the way, do You know why the Grig options don't change when using the GUI?. Please if You know tell me why!!!.


Thanks in advance.

David Gilbert

RE: a fixed error

Post by David Gilbert » Sat Aug 05, 2000 7:59 am

The second constructor just passes control to the first constructor using this(...). The first constructor calls super(...) and then initialises this.verticalLabel. I think it is working OK.

Calling super(...) directly, as you suggest, also works but you should add:

this.verticalLabel = true;

...to your code, to set the default value for the axis label orientation. That's the boolean value you had to remove in the call to super(...).

Is one way more correct than the other? I would have said no, but I might be wrong.

Regards,

DG.

David Gilbert

RE: Grid options

Post by David Gilbert » Sat Aug 05, 2000 8:02 am

I've made a quick fix for the grid options - it was just a piece of code that I forgot to complete (there are others!). I'll e-mail you the file right away - I'm also packaging up some of the bug-fixes into a new download which should get posted in the next day or so.

Regards,

DG.

Locked