problem with displaying x-axis date values

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

problem with displaying x-axis date values

Post by Malad » Fri Jan 10, 2003 3:15 am

Hi,

I am having problem trying to format the x-axis value. I want the dates to be displayed verically in the dd-mm-yy format

When I use this:
DateTickUnit dateUnit = new DateTickUnit(DateTickUnit.DAY, 1, new java.text.SimpleDateFormat("dd/mm/yy"));
axis.setTickUnit(dateUnit);

the program compiles but throws a ServletException. The error msg says:

root cause

java.lang.NoSuchMethodError: com.jrefinery.chart.HorizontalDateAxis.setTickUnit(Lcom/jrefinery/chart/DateTickUnit;)V
at client.LineGraph.doPost(LineGraph.java:97)
....
.
.

and when I add this line:

axis.getTickLabelFormatter().applyPattern("dd-MMM-yyyy");

I get the following compilation error :

root cause

java.lang.NoSuchMethodError: com.jrefinery.chart.HorizontalDateAxis.setTickUnit(Lcom/jrefinery/chart/DateTickUnit;)V
at client.LineGraph.doPost(LineGraph.java:97)


What is even more baffling is when I say
axis.setAutoTickUnitSelection(true);

the date axis range from 7-Jan-2002 to 8-Jul-2002 .

My SQL query clearly states a different date range.
String frmDate = "01/06/2002";
String toDate = "30/06/2002";

Where is it getting the above dates from and what can I do to fix my problem? Your help is much appreciated.

Thanks
--malad--

Malad

Re: problem with displaying x-axis date values

Post by Malad » Fri Jan 10, 2003 3:17 am

sorry! the compilation error that I get is :

LineGraph.java:97: cannot resolve symbol
symbol : method tickLabelFormatter ()
location: class com.jrefinery.chart.HorizontalDateAxis
axis.tickLabelFormatter().applyPattern("dd-MMM-yyyy");
^
1 error

Malad

Re: problem with displaying x-axis date values

Post by Malad » Mon Jan 13, 2003 1:36 am

Hi there!

Could someone throw me some pointers for the above mentioned problems?

I'd be very much appreciated.

Thanks.
malad

David Gilbert

Re: problem with displaying x-axis date values

Post by David Gilbert » Mon Jan 13, 2003 4:53 pm

There is no method tickLabelFormatter() in JFreeChart, so your compiler is correct to report an error.

Regards,

Dave Gilbert

Locked