(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 }, { "x": 0 } ], "columnTypes": [ "float", "float", "float", "float", "float", "float" ], "csv": ",Black (all),White,Indian,Chinese,Average\n2016,12.9,28.1,29.9,33.6,26.4\n2015,16.4,28.9,29.1,32.7,27\n2014,15.8,28,31.4,24.1,26.5\n2013,11.7,29,27.9,23.8,26.7\n2012,16.1,30.8,24.3,30.7,28.4\n2011,14.9,29.3,20.1,27.1,27.2\n2010,10.6,29,21,27,27\n2009,11,29,19,25,24\n2008,13.9,31,27,32,27\n2007,15,31,24,34,26\n2006,17.8,29,21,29,25" }; dataOptions.sort = true dataOptions.complete = completeHandler; Highcharts.data(dataOptions, chartOptions); } catch (error) { console.log(error); completeHandler(undefined); } } var shareUrl = 'https://cloud.highcharts.com/show/exibisu'; var encodedUrl = encodeURIComponent(shareUrl); var template = { chart: { renderTo: 'highcharts-exibisu' }, 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": { "title": { "text": null }, "labels": { "format": "{value}%" } }, "credits": { "branded": true, "text": "Highcharts", "href": "//cloud.highcharts.com/", "enabled": true }, "series": [ { "tooltip": { "valueSuffix": "%" }, "index": 0 }, { "tooltip": { "valueSuffix": "%" }, "index": 1 }, { "tooltip": { "valueSuffix": "%" }, "index": 2 }, { "tooltip": { "valueSuffix": "%" }, "index": 3 }, { "dashStyle": "Dash", "tooltip": { "valueSuffix": "%" }, "index": 4 } ], "subtitle": { "text": "Success rates (acceptances compared to applications), showing largest UK ethnic groups by number of applications, 2006–2016 cycles" }, "title": { "style": { "fontWeight": "bold", "fontSize": "16px" }, "text": "Black undergraduates less than half as likely to be accepted" }, "chart": { "style": { "fontFamily": "\"PT Sans\", \"Lucida Sans Unicode\", Verdana, Arial, Helvetica, sans-serif" }, "type": "line" }, "colors": [ "#f39c12", "rgba(41, 144, 71, 0.23)", "rgba(142, 68, 173, 0.2)", "rgba(52, 152, 219, 0.22)", "#c30730", "#f15c80", "#e4d354", "#2b908f", "#f45b5b", "#91e8e1" ] }; 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); } }());