(function () { var script = document.getElementById('highcharts-script'); function addChart() { function parseData(completeHandler, chartOptions) { try { var dataOptions = { "seriesMapping": [ { "x": 0 } ], "columnTypes": [ "float", "float" ], "csv": "Year,Wealth (Trillions)\n1913,3.1\n1914,3.2\n1915,3.5\n1916,3.6\n1917,3.2\n1918,2.9\n1919,2.9\n1920,2.6\n1921,2.9\n1922,3.3\n1923,3.3\n1924,3.5\n1925,3.7\n1926,3.9\n1927,4.3\n1928,4.9\n1929,5.2\n1930,4.9\n1931,4.3\n1932,3.9\n1933,4.1\n1934,4.3\n1935,4.5\n1936,5.3\n1937,5.1\n1938,5\n1939,5.2\n1940,5.3\n1941,5\n1942,4.9\n1943,5.3\n1944,6.1\n1945,7\n1946,6.8\n1947,6.7\n1948,6.9\n1949,7.2\n1950,7.5\n1951,7.6\n1952,7.9\n1953,8\n1954,8.3\n1955,8.8\n1956,9.2\n1957,9.2\n1958,9.5\n1959,10.1\n1960,10.3\n1961,10.8\n1962,11.3\n1963,11.6\n1964,12.1\n1965,12.8\n1966,13.1\n1967,13.5\n1968,14.5\n1969,14.6\n1970,14.2\n1971,14.5\n1972,15.8\n1973,16.2\n1974,15.1\n1975,14.7\n1976,15.9\n1977,16.6\n1978,17.3\n1979,18.3\n1980,19.5\n1981,19.8\n1982,20.2\n1983,20.9\n1984,21.7\n1985,23.2\n1986,25.4\n1987,26.8\n1988,28\n1989,29.4\n1990,29.8\n1991,30.2\n1992,31.3\n1993,32.1\n1994,32.9\n1995,34.5\n1996,36.8\n1997,39.6\n1998,43.9\n1999,48.9\n2000,50.9\n2001,49.4\n2002,47.5\n2003,49.1\n2004,55\n2005,60.4\n2006,64\n2007,64.2\n2008,56\n2009,50.2\n2010,52.8\n2011,54\n2012,56.2\n2013,62.9\n2014,68.8\n2015,71.3" }; dataOptions.sort = true dataOptions.complete = completeHandler; Highcharts.data(dataOptions, chartOptions); } catch (error) { console.log(error); completeHandler(undefined); } } var shareUrl = 'https://cloud.highcharts.com/show/ulahupo'; var encodedUrl = encodeURIComponent(shareUrl); var template = { chart: { renderTo: 'highcharts-ulahupo' }, 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": "Trillions of 2015 Dollars" }, "labels": { "format": "${value}" } }, "exporting": { "enabled": false }, "xAxis": { "gridLineWidth": 1 }, "credits": { "position": { "x": 20, "y": -1, "align": "left" }, "href": "http://gabriel-zucman.eu/usdina/", "text": "Source: Piketty, Saez, Zucman (2016)" }, "accessibility": { "enabled": false }, "legend": { "enabled": false }, "series": [ { "marker": { "enabled": false }, "tooltip": { "valuePrefix": "$" }, "index": 0 } ], "title": { "text": "Total US Household Wealth (1913-2015)" }, "chart": { "description": null, "type": "line" }, "colors": [ "#B31021", "#434348", "#90ed7d", "#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); } }());