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
Time series tick
Re: Time series tick
Hi,
I have the same problem. Can someone shed light on it? Thanks.
Rich
I have the same problem. Can someone shed light on it? Thanks.
Rich
Re: Time series tick
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
Regards,
Dave Gilbert
Re: Time series tick
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
Try using Millisecond instead of Minute etc. It is processed differently. That said, my next post contains a problem.
Anthony
Re: Time series tick
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
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