Charts for August 2021 EM REIN article
author:
Mike Zavarello
by Mike Zavarello
HTML
<!-- Atlanta Fed scripts -->
<script src="https://www.frbatlanta.org/~/media/javascript/system/UniversalGoogleAnalytics.js"></script>
<script src="https://www.frbatlanta.org/~/media/javascript/highcharts/highcharts-global-settings-min.js"></script>
<!-- standard Highcharts scripts -->
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div class="economyMattersChart" id="container_ConsumersPowerTheEconomy"></div>
CSS
.economyMattersChart { height: 450px; width: 100%; margin: 0 auto; }
JavaScript
$(document).ready(function(){
var iframeWidth_economyMattersChart = $('.economyMattersChart').width();
var iframeHeight_economyMattersChart = $('.economyMattersChart').height();
var sourceLine_ConsumersPowerTheEconomy = 'Note: Data depict sectors as percentage shares of U.S. gross domestic product in the second quarter of 2021. Gross private domestic investment includes the construction of nonresidential structures, the production of equipment and software, private residential construction, and changes in inventories.<br />Source: U.S. Bureau of Economic Analysis, Federal Reserve Bank of St. Louis Federal Reserve Economic Data (FRED)';
setChartDefaults(iframeWidth_economyMattersChart,iframeHeight_economyMattersChart,sourceLine_ConsumersPowerTheEconomy,80);
var chartOptions_ConsumersPowerTheEconomy = {
chart: { marginBottom: 155, marginRight: 20, renderTo: 'container_ConsumersPowerTheEconomy', type: 'bar' },
exporting: {
chartOptions: {
legend: { enabled: false }
},
filename: 'atlanta-fed_economy-matters-consumers-power-the-economy'
},
legend: { enabled: false },
plotOptions: {
series: {
borderWidth: 0, shadow: false,
dataLabels: {
enabled: true, x: 0, y: 0,
style: { fontFamily: 'Arial, sans-serif', fontSize: '16px', textOutline: 'none' },
formatter: function() {
return '<span style="color: ' + this.series.color + ';">' + Highcharts.numberFormat(this.y, 1) + '%</span>';
}
}
}
},
subtitle: { enabled: false },
title: { text: 'Consumers Power the Economy', width: iframeWidth_economyMattersChart * 0.8 },
tooltip: { enabled: false },
xAxis: {
categories: ['Personal consumption expenditures','Gross private domestic investment','Government consumption expenditures and gross investment','Net exports of goods and services'],
labels: { y: 0 }
},
yAxis: {
title: { text: 'Percent share of GDP' }, tickInterval: 20, minorTickInterval: 10, labels: { format:...