Time zone configuration - UTC data on various time zones
Euro / US Dollar trend by 4 hours from 01.01.2015 - 25.03.2015
Universal time - Tue, 24 Mar 2015 23:59:00 GMT
NewYork local time
Sydney local time
Local time
HTML
HTML
<script src="https://cdn.zoomcharts-cloud.com/1/nightly/zoomcharts.js"></script>
<div id="demo"></div>
<p>Universal time - Tue, 24 Mar 2015 23:59:00 GMT</p>
<p>NewYork local time</p>
<div id="demo1"></div>
<p>Sydney local time</p>
<div id="demo2"> </div>
<p>Local time</p>
<div id="demo3"> </div>
CSS
CSS
//No CSS for this example
JavaScript
JavaScript
var settings = {
area: {height: null },
navigation: {
initialDisplayUnit: "4 h"
},
data: {
units: ["h"],
url: "/dvsl/data/time-chart/eurusd-2015.json",
timestampInSeconds: true
},
valueAxisDefault: {
minValue: 1,
maxValue: 1.25,
scaleStep: 0.01
},
timeAxis: {
timeZone: "UTC"
},
currentTime: {
time: 1427241540000 // UTC 24 Mar 2015 23:59:00 GMT
},
info: {
valueFormatterFunction: infoContents
},
series: [
{
id: "cs",
name: "Eur/Usd of period 01.01.2015 - 25.03.2015",
type: "candlestick",
data: {
high: 2,
low: 3,
open: 1,
close: 4
},
style: {
pattern:"bar"
}
}
]
};
function infoContents(values) {
if (!values) { return "No data"; }
return values.sum.toFixed(5);
};
settings.container = document.getElementById("demo1");
settings.timeAxis.timeZone = "America/New_York";
var NewYork = new TimeChart(settings);
settings.container = document.getElementById("demo2");
settings.timeAxis.timeZone = "Australia/Sydney";
var Sydney = new TimeChart(settings);
settings.timeAxis.timeZone = "local";
settings.container = document.getElementById("demo3");
var local = new TimeChart(settings);