xAxis.dateTimeLabelFormats timezone

Technical support, bug reports and more.

xAxis.dateTimeLabelFormats timezone

Postby kfiles on Tue Jul 27, 2010 6:20 pm

I'm experimenting with your excellent charting library to replace Protovis as our graphing framework for network bandwidth. As our network is global, using either UTC or browser local timezone can be problematic.

Sometimes it is necessary for the user to select the timezone (or the server to select the timezone, based upon collector location).

I haven't seen any way with either global.useUTC or xAxis.dateTimeLabelFormats to set a specific timezone for tick labels.

Is there one?
kfiles
 
Posts: 9
Joined: Tue Jul 27, 2010 5:52 pm

Re: xAxis.dateTimeLabelFormats timezone

Postby not on Thu Jul 29, 2010 10:44 am

Hi kfiles,

I understand that all of your data stored in databases use UTC, right?
So you can put the UTC data to the chart and define series.pointStart also in UTC.
Then you can decide which timezone to display for users: UTC or local:

Code: Select all
Highcharts.setOptions({
    global: {
        useUTC: false
    }
});

Remember that it has to be set in Highcharts.setOptions() before chart initialization, rather than in chart options (as it is pointed in options reference: http://www.highcharts.com/ref/#global).
I've prepared a demonstration of how it works at http://jsfiddle.net/3r4E7/1/. I hope that's what you're looking for.
Maciej Piecha,
Highcharts Support Team
User avatar
not
 
Posts: 331
Joined: Mon Jun 07, 2010 4:01 pm

Re: xAxis.dateTimeLabelFormats timezone

Postby kfiles on Fri Jul 30, 2010 6:05 am

That wasn't really what I'm looking for. Our users want to set timezones which are not UTC, but are also not their browser timezone.

e.g., if a NOC operator is working in Shanghai, but monitoring transmission on a subnet in NYC, he wants to set his timezone to UTC-400.

I'm currently fudging this by sending data from the server with the pointStart set to the real value -4hours, and then telling HC to use UTC. That's not ideal.
kfiles
 
Posts: 9
Joined: Tue Jul 27, 2010 5:52 pm

Re: xAxis.dateTimeLabelFormats timezone

Postby not on Fri Jul 30, 2010 11:42 am

Oh, I see your problem now...
kfiles wrote:I'm currently fudging this by sending data from the server with the pointStart set to the real value -4hours, and then telling HC to use UTC. That's not ideal.

If there was an internal feature to do this it would work in similar way, I suppose. So chin up! I believe it is a good solution :)
Maciej Piecha,
Highcharts Support Team
User avatar
not
 
Posts: 331
Joined: Mon Jun 07, 2010 4:01 pm


Return to Highcharts Usage

Who is online

Users browsing this forum: No registered users and 4 guests