TimeSeries Chart with DST Problem (David, help me.)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
luizihjei
Posts: 9
Joined: Thu Sep 03, 2009 9:41 am
antibot: No, of course not.

TimeSeries Chart with DST Problem (David, help me.)

Post by luizihjei » Tue Sep 15, 2009 7:28 am

I'm using jfreechart to display data from database in realtime.
Works great until I reach the day when daylight saving time is 00:59 (November 1, 2009 EDT)
to 1:00 (November 1, 2009 EDT).
Because of the class Millisecond gets the wrong time, it changes 1:00(EDT) to 1:00(EST).
Is there a good way to solve this problem besides override the class of Millisecond.

The Following is the class Millisecond's code :

public long getFirstMillisecond(Calendar calendar) {
int year = this.day.getYear();
int month = this.day.getMonth() - 1;
int day = this.day.getDayOfMonth();
calendar.clear();
calendar.set(year, month, day, this.hour, this.minute, this.second);
calendar.set(Calendar.MILLISECOND, this.millisecond);
//return calendar.getTimeInMillis(); // this won't work for JDK 1.3
return calendar.getTime().getTime();
}

Any help will appreciate.

luizihjei
Posts: 9
Joined: Thu Sep 03, 2009 9:41 am
antibot: No, of course not.

Re: TimeSeries Chart with DST Problem (David, help me.)

Post by luizihjei » Tue Sep 15, 2009 11:52 am

using the FixedMillisecond class to avoid to override the Millisecond class.
Bug there are still some problems with the DateAxis class.
Such as:
protected Date previousStandardDate(Date date, DateTickUnit unit)

There is same problem with the Millisecond class:
the function previousStandardDate changes the EDT 1:00 to the EST 1:00.

The DateAxis tick label will be 01:00 to 00:59
and the DateAxis gridline will disapper soon.

How can I do?
Is there the FixedDateAxis class in the jfreechart package?

Locked