Segmented timeline

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
tmtjond
Posts: 23
Joined: Thu Jul 24, 2008 3:21 am

Segmented timeline

Post by tmtjond » Wed Jun 17, 2009 4:00 pm

I found that it is not possible to set time zone into the segmented timeline.
Any suggestion for implement a time-zone aware segmented timeline?

Thanks.

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Re: Segmented timeline

Post by skunk » Wed Jun 17, 2009 4:21 pm

Try setting the TimeZone on the DateAxis

Code: Select all

public void setTimeZone(java.util.TimeZone zone)

tmtjond
Posts: 23
Joined: Thu Jul 24, 2008 3:21 am

Re: Segmented timeline

Post by tmtjond » Thu Jun 18, 2009 2:39 am

Setting timezone to the dateAxis could only affect the 'display value' of the time?

However, the segmented time is going to control the possible valid time period:
say, the segmented time is defined as Mon 9:00am to Fri 9pm, with the DEFAULT timezone

Using getDefault which creates a TimeZone based on the time zone where the program is running.
Clients with different default timezone (say, Japan vs New York) would create same range: Mon 9:00am to Fri 9pm
but indeed, the 'actual' values (after timezone effect added) would be different.

Correct me if I am wrong.

tmtjond
Posts: 23
Joined: Thu Jul 24, 2008 3:21 am

Re: Segmented timeline

Post by tmtjond » Thu Jun 18, 2009 10:25 am

I read the test cases.

It seems that it could only control the timeline's timezone by TimeZone.setDefault(timeZone).

David, wanna ask is there any reason you don't add a setter for the timezone for the segmentedTimeline?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Segmented timeline

Post by david.gilbert » Thu Jun 18, 2009 1:51 pm

tmtjond wrote:David, wanna ask is there any reason you don't add a setter for the timezone for the segmentedTimeline?
I'm not sure, my head always hurts when I look at that code. I vaguely recall that the timeline deals with everything in UTC, so a TimeZone can only apply to the DateAxis (i.e. labelling). But I'd have to study the code, and I don't have the time for that at the moment.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

tmtjond
Posts: 23
Joined: Thu Jul 24, 2008 3:21 am

Re: Segmented timeline

Post by tmtjond » Fri Jun 19, 2009 8:44 am

It's okay, thanks for your reply.

Locked