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.
Segmented timeline
Re: Segmented timeline
Try setting the TimeZone on the DateAxis
Code: Select all
public void setTimeZone(java.util.TimeZone zone)
Re: Segmented timeline
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.
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.
Re: Segmented timeline
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?
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?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Segmented timeline
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.tmtjond wrote:David, wanna ask is there any reason you don't add a setter for the timezone for the segmentedTimeline?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Re: Segmented timeline
It's okay, thanks for your reply.