Hi All,
I am trying to use VerticalLogarithmicAxis to show values between 0-1.
I can't set the axis range to display correctly.
I see only the top range 10^0, and don't see any log grid.
the data doesn't apear, probebly becuase the axis range is not correct.
i use the follwing code:
BasicTimeSeries MySeries = new BasicTimeSeries("Myseries", "Second", "Value", Second.class);
TimeSeriesCollection data = new TimeSeriesCollection();
data.addSeries(MySeries );
JFreeChart chart = ChartFactory.createTimeSeriesChart(title, domain, range, data, true);
XYPlot plot = chart.getXYPlot();
VerticalLogarithmicAxis vla = new VerticalLogarithmicAxis(range);
vla.setAutoRange(false);
vla.setMaximumAxisValue(1.0);
vla.setMinimumAxisValue(0.0);
vla.setAutoRangeIncludesZero(true);
plot.setRangeAxis(vla);
MySeries.add(new Second(d), new Double(1/(10^2)) );
MySeries.add(new Second(d), new Double(2/(10^2)) );
Any help will be very appriciated,
thanks,
yaron
VerticalLogarithmicAxis - unable to show values between 1 an
Re: VerticalLogarithmicAxis - unable to show values between
Just a thought, have you tried setting the lower bounds to a positive, non-zero value?
DaveOD
DaveOD
Re: VerticalLogarithmicAxis - unable to show values between
The axis label is using 10^0 (which is equal to 1), because '^' is a common symbol meaning 'to the power of'. So I think the axis range is correct, although I'm not sure why you don't see more grid lines.
BUT, in Java '^' is the exlusive OR operator, it does NOT raise a number to the nth power. Try running the following code to see what I mean:
System.out.println(10^2); // answer = 8
System.out.println(1 / (10^2)); // answer = 0 (because of integer rounding)
After you fix that problem, you should see some data on your chart.
Regards,
DG
BUT, in Java '^' is the exlusive OR operator, it does NOT raise a number to the nth power. Try running the following code to see what I mean:
System.out.println(10^2); // answer = 8
System.out.println(1 / (10^2)); // answer = 0 (because of integer rounding)
After you fix that problem, you should see some data on your chart.
Regards,
DG
Re: VerticalLogarithmicAxis - unable to show values between
Hi,
Thanks alot, your answers really helped me.
Yaron
Thanks alot, your answers really helped me.
Yaron