Setting X-Axis and Y-Axis values

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

Setting X-Axis and Y-Axis values

Post by Girish » Mon Sep 30, 2002 7:42 am

Hi All,
In the Free chart, the X-Axis aor the Y-Axis values will have decimal position. If my scale is from 0 to 1, then there qill be eleven entries 0, 0.1, 0.2, 0.3, ...., 1.0. If I want it to be numbers only 0 and 1, what shoule I do??

Are there any methods exposed or some setting to the JFreeChart object??

Please help me in this.

Regards
Girish

Andreas Schroeder

Re: Setting X-Axis and Y-Axis values

Post by Andreas Schroeder » Mon Sep 30, 2002 8:07 am

Hi Girish,
what you could do is to specify your own NumberTickUnit:

NumberTickUnit unit = new NumberTickUnit(1.0, NumberFormat.getNumberInstance());

and then

axis.setTickUnit(unit);
(where axis is a NumberAxis)

Regards,

Andreas Schroeder

Locked