(function () {
var script = document.getElementById('highcharts-script');
function addChart() {
function parseData(completeHandler, chartOptions) {
try {
var dataOptions = {
"seriesMapping": [
{
"x": 0
}
],
"columnTypes": [
"string",
"float"
],
"csv": ",\nLowest,49\nSecond,66\nThird,80\nFourth,89\nTop Fifth ,95"
};
dataOptions.sort = true
dataOptions.complete = completeHandler;
Highcharts.data(dataOptions, chartOptions);
} catch (error) {
console.log(error);
completeHandler(undefined);
}
}
var shareUrl = 'https://cloud.highcharts.com/show/ydiwuxo';
var encodedUrl = encodeURIComponent(shareUrl);
Highcharts.setOptions({
"lang": {
"decimalPoint": ".",
"thousandsSep": ","
}
});
var template = {
chart: {
renderTo: 'highcharts-ydiwuxo'
},
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 = {
"yAxis": {
"gridLineColor": "#000000",
"minorGridLineColor": "#000000",
"minorTickColor": "#000000",
"gridLineWidth": 0.75,
"tickColor": "#000000",
"maxColor": "#000000",
"lineColor": "#000000",
"minorGridLineWidth": 0.75,
"title": {
"style": {
"color": "#000000"
},
"text": null
},
"labels": {
"format": "{value}%"
}
},
"xAxis": {
"tickWidth": 0.75,
"minorGridLineColor": "#000000",
"gridLineColor": "#000000",
"minorTickColor": "#000000",
"tickColor": "#000000",
"tickLength": 0,
"lineColor": "#000000",
"title": {
"style": {
"color": "#000"
},
"text": "Household income quintile"
},
"minorGridLineWidth": 0.75,
"type": "category",
"lineWidth": 0.75
},
"exporting": {
"sourceWidth": 560,
"sourceHeight": 370
},
"credits": {
"href": null,
"text": "Source: Adobe Analytics",
"enabled": false
},
"legend": {
"x": 56,
"align": "left",
"enabled": false
},
"series": [
{
"color": "#83c7e4",
"index": 0
}
],
"subtitle": {
"x": 40,
"style": {
"fontSize": "14px",
"fontWeight": "normal",
"color": "#000000"
},
"text": "While nearly all wealthy U.S. households are online, only about half of the poorest ones are.",
"align": "left"
},
"tooltip": {
"enabled": false
},
"title": {
"margin": 40,
"x": 40,
"style": {
"fontWeight": "bold",
"color": "#000000",
"fontSize": "16px"
},
"text": "Internet Use at Home by Income",
"align": "left"
},
"chart": {
"borderColor": "#000000",
"style": {
"fontFamily": "Arial"
},
"type": "column"
},
"colors": [
"#f06d2c",
"#cc2a29",
"#54b89e",
"#6594b0",
"#5d934f",
"#5d64aa",
"#0060fc",
"#abaaaf",
"#f9c6af",
"#ffffff"
]
};
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 = '//cloud.highcharts.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);
}
}());