(function () {
var script = document.getElementById('highcharts-script');
function addChart() {
function parseData(completeHandler, chartOptions) {
try {
var dataOptions = {
"seriesMapping": [
{
"x": 0
},
{
"x": 0
},
{
"x": 0
},
{
"x": 0
}
],
"columnTypes": [
"date",
"string",
"string",
"string",
"string"
],
"csv": ",GBP/USD,FTSE 100,FTSE 250,Bankaktien*\n1467936000000,-13.71,3.98,-6.67,-18.09\n1467849600000,-13.87,3.09,-8.28,-20.52\n1467763200000,-13.22,1.98,-9.6,-21.87\n1467676800000,-11.5,3.27,-9.22,-19.76\n1467590400000,-11.52,2.91,-7.02,-17.71\n1467331200000,-11.6,3.78,-5.01,-16.18\n1467244800000,-11.47,2.62,-6.13,-16.3\n1467158400000,-10.48,0.35,-7.68,-16.88\n1467072000000,-11.13,-3.12,-10.56,-18.61\n1466985600000,-11.97,-5.62,-13.65,-20.08\n1466726400000,-8.82,-3.15,-7.19,-14.96\n1466640000000,0,0,0,0"
};
dataOptions.sort = true
dataOptions.complete = completeHandler;
Highcharts.data(dataOptions, chartOptions);
} catch (error) {
console.log(error);
completeHandler(undefined);
}
}
var shareUrl = 'https://app.everviz.com/show/omisac';
var encodedUrl = encodeURIComponent(shareUrl);
var template = {
chart: {
renderTo: 'highcharts-omisac'
},
navigation: {
menuItemStyle: {
fontFamily: Highcharts.SVGRenderer.prototype.getStyle().fontFamily,
padding: '2px 10px'
}
},
exporting: {
buttons: {
contextButton: {
menuItems: [{
text: '' +
'Share on Facebook'
}, {
text: '' +
'Share on Google+'
}, {
text: '' +
'Share on Twitter'
}, {
text: '' +
'Share on LinkedIn'
}, {
separator: true
}]
.concat(Highcharts.getOptions().exporting.buttons.contextButton.menuItems)
.concat([{
separator: true
}, {
text: '' + 'Edit chart'
}, {
text: '' + 'Create chart'
}])
}
}
}
};
var chartOptions = {
"plotOptions": {
"series": {
"dataLabels": {
"format": "{y}%"
}
}
},
"yAxis": {
"title": {
"text": null
},
"labels": {
"format": "{value}%"
}
},
"exporting": {
"enabled": false
},
"xAxis": {
"title": {
"text": null
}
},
"credits": {
"branded": true,
"text": "Highcharts",
"href": "//app.everviz.com/",
"enabled": true
},
"series": [
{
"color": "#aa5888",
"marker": {
"enabled": true
},
"tooltip": {
"valueSuffix": "%"
},
"index": 0
},
{
"color": "#afa0a0",
"dashStyle": "LongDash",
"marker": {
"enabled": true
},
"tooltip": {
"valueSuffix": "%"
},
"index": 1,
"type": "spline"
},
{
"color": "#c6c6c6",
"marker": {
"enabled": true
},
"tooltip": {
"valueSuffix": "%"
},
"index": 2
},
{
"tooltip": {
"valueSuffix": "%"
},
"index": 3
}
],
"tooltip": {
"shared": true
},
"title": {
"style": {
"fontSize": "0px"
},
"text": "Brexit Aftermath"
},
"chart": {
"style": {
"fontFamily": "Arial"
},
"type": "spline",
"height": 450
}
};
parseData(function (dataOptions) {
// Merge series configs
if (chartOptions.series && dataOptions) {
Highcharts.each(chartOptions.series, function (series, i) {
chartOptions.series[i] = Highcharts.merge(series, dataOptions.series[i]);
});
}
var options = Highcharts.merge(dataOptions, chartOptions, template);
var chart = new Highcharts['Chart'](options);
}, chartOptions);
}
// Load the Highcharts script if undefined, and add the chart
if (typeof Highcharts !== 'undefined') {
addChart();
} else if (script) {
script.deferredCharts.push(addChart);
} else {
script = document.createElement('script');
script.id = 'highcharts-script';
script.src = '//app.everviz.com/resources/js/highstock-cloud-5.0.7.js';
script.type = 'text/javascript';
script.deferredCharts = [addChart];
script.onload = function () {
// Prevent double firing of event in IE9/IE10
if (!script.chartsAdded) {
script.chartsAdded = true;
while(script.deferredCharts.length) {
script.deferredCharts.shift()();
}
}
};
script.onreadystatechange = function() {
if (this.readyState == 'complete' || this.readyState == 'loaded') {
script.onload();
}
};
document.getElementsByTagName('head')[0].appendChild(script);
}
}());