(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\n1913,32231\n1914,32372\n1915,34682\n1916,35703\n1917,30675\n1918,27848\n1919,27623\n1920,24185\n1921,26404\n1922,29640\n1923,29778\n1924,30456\n1925,32179\n1926,33343\n1927,35772\n1928,40972\n1929,42733\n1930,39397\n1931,34284\n1932,30846\n1933,32760\n1934,33800\n1935,35636\n1936,41259\n1937,39822\n1938,38343\n1939,39785\n1940,39855\n1941,37663\n1942,36343\n1943,39070\n1944,44109\n1945,49931\n1946,48101\n1947,46780\n1948,46858\n1949,47964\n1950,49265\n1951,49193\n1952,50267\n1953,50364\n1954,51374\n1955,53469\n1956,54506\n1957,54005\n1958,54791\n1959,56799\n1960,57072\n1961,58861\n1962,60388\n1963,61047\n1964,63060\n1965,65905\n1966,66415\n1967,68046\n1968,72228\n1969,72050\n1970,69050\n1971,70025\n1972,75081\n1973,76555\n1974,70425\n1975,68273\n1976,72913\n1977,75540\n1978,77796\n1979,81408\n1980,85443\n1981,86249\n1982,86899\n1983,88999\n1984,91663\n1985,97188\n1986,105464\n1987,110443\n1988,114136\n1989,118832\n1990,119147\n1991,119262\n1992,121675\n1993,123364\n1994,124989\n1995,129554\n1996,136275\n1997,145041\n1998,159118\n1999,175177\n2000,180097\n2001,173167\n2002,165024\n2003,168978\n2004,187458\n2005,203960\n2006,214257\n2007,212761\n2008,183750\n2009,163337\n2010,170389\n2011,172868\n2012,178819\n2013,198643\n2014,215378\n2015,221532" }; dataOptions.sort = true dataOptions.complete = completeHandler; Highcharts.data(dataOptions, chartOptions); } catch (error) { console.log(error); completeHandler(undefined); } } var shareUrl = 'https://cloud.highcharts.com/show/ipelypa'; var encodedUrl = encodeURIComponent(shareUrl); Highcharts.setOptions({ "lang": { "thousandsSep": "," } }); var template = { chart: { renderTo: 'highcharts-ipelypa' }, 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": "2015 Dollars" }, "labels": { "format": "${value:,.0f}" } }, "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": "Per Capita 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); } }());