BUG ? Y axis values not shown

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
slom
Posts: 1
Joined: Fri Nov 28, 2003 3:10 pm

BUG ? Y axis values not shown

Post by slom » Fri Nov 28, 2003 3:18 pm

Is this a bug or ?

XYLineChart doesn't show Y axis values in some specific situations.

example;

x=0, y=3.382265073
x=1, y=3.382265073
x=2, y=3.382265073
x=3, y=3.382265073
x=4, y=3.382265073
...
x=19, y=3.382265073

For other values of y it works well.
Labels are shown correctly.

uls
Posts: 25
Joined: Fri Oct 17, 2003 10:46 am

Post by uls » Fri Nov 28, 2003 3:47 pm

i don't know if it's a bug, but it's definitely not a feature.
this happens always if you want to chart the same value. as soon as you add a different value everything shows up.

have no solution for this either.

JFreeChart Support
Posts: 3
Joined: Fri Nov 28, 2003 3:13 pm
Location: Support Desk
Contact:

Post by JFreeChart Support » Fri Nov 28, 2003 4:38 pm

It is a bug in the NumberAxis class - the standard tick unit collection does not have a tick size small enough for the range that is auto-calculated for the axis given a data range of zero. That will get fixed in a future release. In the meantime, one way to avoid the problem is to specify a minimum auto-range for the axis:

Code: Select all

XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis axis = (NumberAxis) plot.getRangeAxis();
axis.setAutoRangeMinimumSize(1.0);
Regards,

JFreeChart Support Team

nerudra
Posts: 1
Joined: Thu Nov 17, 2011 1:34 pm
antibot: No, of course not.

Re: BUG ? Y axis values not shown

Post by nerudra » Thu Nov 17, 2011 1:42 pm

Can I follow-up on this thread? This still seems to occur in jfreechart 1.0.9....whenever marker value is at a precision of 1.0e-8 or greater, the y-axis will disappear.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: BUG ? Y axis values not shown

Post by matinh » Thu Nov 17, 2011 1:47 pm

Hi!

Not the axis will disappear but the tick marks, right?

You have to provide either a range for the axis, or a suitable TickUnit. This has been discussed earlier. Please search the forum and/or the bug tracker.

hth,
- martin

Locked