Category: E-learning Step by Step
Case #2
Create a stacked area chart showing components of a total
Objectives
- Navigate the Country & Region database
- Use the slider feature to view data
- Use graph layout to edit the chart
- Adjust the legend and axes
Solution
If you get stuck trying to replicate the example, use the video or worksheet to see what to do next.
Video (Note that since making this video we have further developed some elements in app and our structure of the data)
To the see exact construction of the document, you can download the file here.
Learning resources for this case
Different views – entry-points and how to work with them
Adding an alternate scale to charts
Worksheet – Case #2 – Create a stacked area chart showing components of a total
Finding Data
To find the US Outstanding debt per sector, the best approach is to start looking in Country & Region > United States. Series can be found under the category Financial Accounts > Summaries, and table D.3.
Set the slider to the level 2 of 3 and select the components of Domestic non-financial sectors (so all the series except the total) as well as Foreign Sectors and Domestic Financial Sector.
Charting
Graph Layout
All the series are initially displayed as lines, though in this example you should a stacked area style instead. To change the chart style, right-click on the chart, and select Graph Layout.
Click above the list of series where it says “line” and change it to “stacked area”.
Series are added to the chart as they are listed; so, for a stacked area chart, the 1st series is placed at the bottom, and the last one at the top of the area. You can change the order of the series by dragging them to a different position in the list.
Location of the legend
Next, you need to move the legend from the bottom of the chart to inside the chart area. To do so, click on it. In the presentation properties tab, change the layout mode to one column, and the location to floating. You can move the legend around the chart by dragging it.
Vertical Axis
To display the vertical axis on both sides of the chart, click on it and look at the settings available under Axis, in the presentation properties tab. Set the synchronize setting to values, to display the same values on both sides of the chart.
Video – Case #2 – Create a stacked area chart showing components of a total
Level 1
- Case #1 - Comparing GDP across countries using Rebase
- Case #2- Create a stacked area chart showing components of a total
- Case #3 - Calculating and presenting year-on-year % change
- Case #4 - Working with series that have different frequencies
- Case #5 - Calculating a 12-month rolling sum
- Case #6 - Create a category chart using Scalar
- Case #7 - Create a Scatter Chart
- Case #8 - Using Cross Section to analyze a group of series
- Case #9 - Using Correlation to determine the best lag
- Case #10 - Calculating moving average & adding recession bands
Test your skills
Case-based learning allows you to improve your skill level using real examples. Use these cases to test your knowledge and discover faster, simpler and more powerful ways to work.
As you proceed through each level you’ll be given more advanced cases to gradually increase your skills.
Each case includes:
- a chart you need to recreate
- case objectives
- help materials you can use if you get stuck
For each case we’ll also suggest relevant tutorials from the user guide that will help you fill in any gaps in your knowledge.
Going through the exercises presented below will allow you to understand and discover the powerful value of Macrobond formula language.
Case #1
Comparing GDP across countries using Rebase
Objectives
- Use the Concept & Category database to find the same data for multiple countries
- Use the Rebase analysis to compare GDP series
- Apply basic charting adjustments
- Add an horizontal line at 100
Solution
If you get stuck trying to replicate the example, use the video or worksheet to see what to do next.
Video (Note that since making this video we have further developed some elements in app and our structure of the data)
To the see exact construction of the document, you can download the file here.
Learning resources for this case
Different views – entry-points and how to work with them
Concept & Category view – comparable data in data-tree
Transcript – Comparing GDP across countries using Rebase – Exercise 1
[01 What you’ll learn]
In this exercise, we’ll look at how to find the same data for multiple countries at once, using the Economics by Concept database. Then, we'll try to compare and measure how each country has recovered after the financial crisis, by the using rebase analysis. Finally, we will apply some basic charting adjustments.
[02 Finding data - introduction]
The first step is to find the data. Since we’re looking at comparing an indicator across countries, we should start by taking a look at the Economics by Concept database. For this exercise, we’ll use GDP from National Sources.
[03 Finding data – by Concept]
You can find GDP series under National Accounts. Now we just need to select the countries we are interested in and add the series to the document. To add multiple series at once, hold on CTRL while selecting series. And then press “Add selected Series”.
[04 Analysis Tree – introduction]
Now that we’ve added our series to the document, let’s move on to the Analysis tree. As you can see, by default a time chart is already in place below the series list. Right now, it shows the raw series. Let’s insert a Rebase analysis before the chart to compare their evolution.
[05 Rebase analysis]
In Rebase, the next step is to define the settings for our analysis. We’ll use the Absolute Method and set the base date to the 1st of January 2008. To apply these settings to the rest of the series, we will use the fill-down arrow. To see the result click on time chart.
[06 Editing the chart – start date]
We have our analysis in place, but the chart could still be improved a bit to suit our purposes. We can adjust the time range, like clicking on the X-axis and looking up the command bar, at the Presentation properties tab. Under Display range, we will set the start date to 2008.
[07 Editing the chart – title]
To edit text, double click on a text element, such as the chart title, and adjust the text in the editor that pops up.
[08 Editing the chart – legend text]
To edit the legend text for a specific series, you’ll need to double click on its graph in the chart. Clicking on the legend itself allows you to edit the legend as a whole. To tidy it up a bit, we can remove the analysis text.
[09 Editing the chart – horizontal line]
To add the finishing touch let’s highlight the reference value, which in this case is 100. Click on the Chart annotations tab and select horizontal line. You can place it manually, but if you want to make sure it’s in the exact position, type it in, here.
[10 Conclusions]
If you want to save the document you can do so via the file menu. You can also export the chart to Microsoft Office by right clicking on it selecting Copy, and pasting it into an Office document. And that’s how it’s done.