m3lis
Posts: 39
Joined: Thu Apr 03, 2014 1:38 pm

useUTC setting for individual chart in v7.2

Hello,

I have the following setting in my application

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

since I want all charts in my application to be localized.

However, I do want a single individual chart to NOT be localized, that is to have its timestamps as UTC.

Is there a way to achieve that in version 7.2?

I tried time.useUTC on my chart as per the documentation, but it does not seem to work (maybe because of the version?)

Thanks
User avatar
dawid.d
Posts: 848
Joined: Thu Oct 06, 2022 11:31 am

Re: useUTC setting for individual chart in v7.2

Hi,

Thanks for the question!

Generally, useUTC is set globally and setting it for individual charts is a bit problematic. However, it can be achieved in a somewhat tricky way. See the demo below.

Demo: http://jsfiddle.net/highcharts/LH43k/

I hope you will find it useful
Best regards!
Dawid Draguła
Highcharts Developer
m3lis
Posts: 39
Joined: Thu Apr 03, 2014 1:38 pm

Re: useUTC setting for individual chart in v7.2

Many thanks for your reply and suggestion.

Unfortunately, I think this is not applicable for our case, as we have multiple charts in various modules in our application (in the range of 100-200 instances). It would imply going to each chart and binding the mouseover event individually.

I ended up working around the issue by leaving the global setting as is, and then going to the chart that I want to override it and change the labels and tooltip through their formatter functions as needed. Seems to do the trick for now.
User avatar
dawid.d
Posts: 848
Joined: Thu Oct 06, 2022 11:31 am

Re: useUTC setting for individual chart in v7.2

You're welcome!
I'm glad you found a workaround for it. If you'll have any problems in the future, don't hesitate to contact us.

Regards!
Dawid Draguła
Highcharts Developer

Return to “Highcharts Stock”