Forcing Timezone

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
uptime
Newbie
Newbie
Posts: 5
Joined: Fri Nov 15, 2002 12:00 am

Forcing Timezone

Post by uptime » Thu Feb 23, 2012 7:46 pm

We are using TeeChart as a Java applet, and we are currently adding to a series by adding a pair of date and value for line charts, specifically

Code: Select all

public int add(DateTime x, double y)
Internally it adds the time in milliseconds to the Series, but when the chart is rendered to the user, it is adjusted to the client's time zone.
Example:
Chart data time range is in EST and display as data from 1-2 PM, but the client in PST sees that data as 4-5 PM.

We would like to keep the date range always fixed regardless of where the client is, so if they are in Japan or Los Angeles the chart will always show with the date range of 1-2PM.

Is there anyway we can force the axis to translate all the time in milliseconds to a set timezone?

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Forcing Timezone

Post by Yeray » Tue Feb 28, 2012 12:47 pm

Hi,

TeeChart takes the format from the system:

Code: Select all

    public DateFormat dateTimeDefaultFormat(double astep)
    {
        return (astep <= 1)
                ? DateFormat.getTimeInstance(DateFormat.SHORT)
                : DateFormat.getDateInstance(DateFormat.SHORT);
    }
You can probably change the system timezone temporally.
Alternatively, you could use the according events to manually format the strings.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply