I am trying to understand how the timezone
option in time
works. The API page links to a jsfiddle with two different charts using distinct time zones. The charts seem to have no difference regarding their axis labels and data tooltip. So, my question is: what does timezone
actually do?
I changed the original demo code to add a new chart with different time zone and also added a call to time.dateFormat()
method for each chart and log the result in the console. There, I can see different outputs that respect the time zones defined for each chart.
Here’s the link to the jsfiddle: https://jsfiddle.net/pofd3sLh/1/
Sample code of one of the charts:
Highcharts.chart("container2", {
title: {
text: "New York time",
},
time: {
timezone: "America/New_York",
},
xAxis: {
type: "datetime",
},
series: [
{
data: [
29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1,
95.6, 54.4,
],
pointStart: "2017-01-01",
pointInterval: 36e5,
},
],
})