Time series tick

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

Time series tick

Post by Shawn » Fri Feb 22, 2002 7:00 pm

Hi,

I am using JFreechart to draw a daily time series
chart. Why the data point is not consistent with the
horizontal date tick. There seems several hours lag
between these two. Any one knows the reason?

Thanks

Rich

Re: Time series tick

Post by Rich » Sun Feb 24, 2002 8:25 pm

Hi,

I have the same problem. Can someone shed light on it? Thanks.

Rich

David Gilbert

Re: Time series tick

Post by David Gilbert » Mon Feb 25, 2002 4:26 pm

It's most likely the problem with the getStart() and getEnd() methods in the TimePeriod subclasses not taking into account the time zone. There's no fix for this yet...

Regards,

Dave Gilbert

Anthony Berglas

Re: Time series tick

Post by Anthony Berglas » Thu Mar 07, 2002 1:46 am

Yes, I found that -- a Day is a GMT day!

Try using Millisecond instead of Minute etc. It is processed differently. That said, my next post contains a problem.

Anthony

Dean Michaels

Re: Time series tick

Post by Dean Michaels » Thu Mar 07, 2002 11:27 pm

The amount of "drift" is double your local timezone offset from GMT.

It appears that it is a bug with com.jrefinery.data.TimeSeriesCollection.

/**
* Calculates the offset (in milliseconds) of the default time zone from GMT.
*/
private int calculateZoneOffset(Date time) {

TimeZone zone = TimeZone.getDefault();
int result = zone.getRawOffset();
if (zone.inDaylightTime(time)) {
result += 60*60*1000;
}
// return result; // the offset it the wrong way.
return (0-result) ; // return the negative value instead

}


This cleaned it up for me

Dean Michaels

Re: Time series tick

Post by Dean Michaels » Thu Mar 07, 2002 11:28 pm

Damn, tabs don't work in this phorum.

Locked