Alignment of units on the axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
d_rambabu
Posts: 8
Joined: Mon Apr 14, 2008 8:36 am
Location: Hyderabad, India
Contact:

Alignment of units on the axis

Post by d_rambabu » Fri Dec 26, 2008 2:07 pm

Hi,
I am using a simple NumberAxis(for range) for creating my graph. The issue is that when auto scaling is on, the alignment of units is not always consistent. The axis doesnt always start at zero. In addition, the lowest value used for scaling the axis is not always rendered. Is there a way to configure the alignment of units?

2. Do we have a documentation on how to use the zoom features in chart panel? I've got a license for the developer guide but it doesnt provide any.

-Rambabu

d_rambabu
Posts: 8
Joined: Mon Apr 14, 2008 8:36 am
Location: Hyderabad, India
Contact:

Re: Alignment of units on the axis

Post by d_rambabu » Fri Dec 26, 2008 2:08 pm

d_rambabu wrote:Hi,
I am using a simple NumberAxis(for range) for creating my graph. The issue is that when auto scaling is on, the alignment of units is not always consistent. The axis doesnt always start at zero. In addition, the lowest value used for scaling the axis is not always rendered. Is there a way to configure the alignment of units?

2. Do we have a documentation on how to use the zoom features in chart panel? I've got a license for the developer guide but it doesnt provide any.

-Rambabu

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

Post by skunk » Fri Dec 26, 2008 2:37 pm

1.

Code: Select all

public void setAutoRangeIncludesZero(boolean flag)
2. Zooming is implemented using

Code: Select all

public void setRange(double lower, double upper)

d_rambabu
Posts: 8
Joined: Mon Apr 14, 2008 8:36 am
Location: Hyderabad, India
Contact:

Post by d_rambabu » Fri Dec 26, 2008 2:43 pm

Hi,
Thanks for your reply.
If it is ok not to have 0 in the range, can we control displaying the unit for the lowest value(on the scale)?

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

Post by skunk » Fri Dec 26, 2008 3:37 pm

If you wish to leave some empty space on the axis when it is auto calculated then you can use these methods to determine the amount

Code: Select all

public void setLowerMargin(double margin)
public void setUpperMargin(double margin)

Locked