(function () { var script = document.getElementById('highcharts-script'); function addChart() { function parseData(completeHandler, chartOptions) { try { var dataOptions = { "seriesMapping": [ { "x": 0 } ], "columnTypes": [ "float", "float" ], "csv": "Year,Cleantech Patents\n2001,14968\n2002,14927\n2003,15669\n2004,15037\n2005,13363\n2006,15677\n2007,14876\n2008,14662\n2009,15970\n2010,22918\n2011,24878\n2012,27855\n2013,31606\n2014,35271\n2015,34941\n2016,31991" }; dataOptions.sort = true dataOptions.complete = completeHandler; Highcharts.data(dataOptions, chartOptions); } catch (error) { console.log(error); completeHandler(undefined); } } var shareUrl = 'https://cloud.highcharts.com/show/yxevozu'; var encodedUrl = encodeURIComponent(shareUrl); Highcharts.setOptions({ "lang": { "thousandsSep": "," } }); var template = { chart: { renderTo: 'highcharts-yxevozu' }, 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": { "line": { "linecap": "square", "lineWidth": 3 } }, "yAxis": { "endOnTick": false, "min": 20, "max": 50000, "tickInterval": 10000, "title": { "style": { "color": "#000" }, "text": null }, "labels": { "format": "{value:.,0f}" } }, "xAxis": { "tickLength": 0, "title": { "style": { "color": "#000" }, "text": null } }, "exporting": { "sourceWidth": 570, "sourceHeight": 340 }, "credits": { "href": null, "text": "Source: Brookings\u0027 analysis of Moody\u0027s Analytics estimates", "enabled": false }, "legend": { "x": 35, "align": "left" }, "series": [ { "color": "#1b80c4", "marker": { "enabled": false }, "index": 0 } ], "subtitle": { "x": 35, "style": { "fontSize": "14px", "fontWeight": "normal" }, "text": null, "align": "left" }, "tooltip": { "pointFormat": "\u003cb\u003e{point.y}\u003c/b\u003e" }, "title": { "x": 35, "style": { "fontWeight": "bold" }, "text": "Cleantech on the decline", "align": "left" }, "chart": { "borderColor": "#000000", "style": { "fontFamily": "Arial" }, "type": "line" }, "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); } }());