Page 1 of 1

Forcing Timezone

Posted: Thu Feb 23, 2012 7:46 pm
by 6924015
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?

Re: Forcing Timezone

Posted: Tue Feb 28, 2012 12:47 pm
by yeray
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.