setting gap on y axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
BubikolRamios
Posts: 9
Joined: Sun Dec 19, 2010 1:51 am
antibot: No, of course not.

setting gap on y axis

Post by BubikolRamios » Thu Dec 23, 2010 9:32 am

what I have now is:

Code: Select all

rangeAxis.setRange(min,max)
which draws as:
Image

But I don't want min/max to go exactly to the bottom/top (in some cases goes off the gray area !). There should be a gap to bottom/top set in pixels !
I tryed to calculete something,to extend the y range a bit, but it is futile as range on y changes a lot with different data.

Is there a way to set fixed gap in pixels ?
EDIT: I see there is a default gap on x axis, rather large I would say, so I gues it can be changed(or is it just 1 unit to the left and right), same possibly goes for y axis ?

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Re: setting gap on y axis

Post by skunk » Thu Dec 23, 2010 3:03 pm

Extra space in pixels is not supported. You can define margins as a percentage of the value and then call

Code: Select all

public void setRangeWithMargins(double lower, double upper)

BubikolRamios
Posts: 9
Joined: Sun Dec 19, 2010 1:51 am
antibot: No, of course not.

Re: setting gap on y axis

Post by BubikolRamios » Thu Dec 23, 2010 9:25 pm

Thanks.

Locked