(function () { var script = document.getElementById('highcharts-script'); function addChart() { function parseData(completeHandler, chartOptions) { try { var dataOptions = { "seriesMapping": [ { "x": 0 }, { "x": 0 }, { "x": 0 } ], "columnTypes": [ "float", "float", "float" ], "csv": ",Independent,Maintained\n2016,37.5,62.5\n2015,37.7,62.3\n2014,37.8,62.2\n2013,38.6,61.4\n2012,36.7,63.3\n2011,41.2,58.8\n2010,40.7,59.3\n2009,42.4,57.6\n2008,40.5,59.5\n2007,44.9,55.1\n2006,44.3,55.7" }; dataOptions.sort = true dataOptions.complete = completeHandler; Highcharts.data(dataOptions, chartOptions); } catch (error) { console.log(error); completeHandler(undefined); } } var shareUrl = 'https://cloud.highcharts.com/show/ywewuma'; var encodedUrl = encodeURIComponent(shareUrl); var template = { chart: { renderTo: 'highcharts-ywewuma' }, 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": { "stacking": "percent" } }, "yAxis": { "title": { "text": "% of undergraduate intake" }, "labels": { "format": "{value}%" } }, "credits": { "branded": true, "text": "Highcharts", "href": "//cloud.highcharts.com/", "enabled": true }, "series": [ { "tooltip": { "valueSuffix": "%" }, "index": 0 }, { "tooltip": { "valueSuffix": "%" }, "index": 1 } ], "subtitle": { "text": "Proportion of ‘home’ undergraduates, by school type " }, "title": { "style": { "fontWeight": "bold", "fontSize": "16px" }, "text": "Independent vs maintained sector intake has plateaued" }, "chart": { "style": { "fontFamily": "\"PT Sans\", \"Lucida Sans Unicode\", Verdana, Arial, Helvetica, sans-serif" }, "type": "area" }, "colors": [ "#c30730", "#00717c", "#c30730", "#f7a35c", "#8085e9", "#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); } }());