Excel Color Area between Two Curves
SoftTech Tutorials
In this video, I will explain how you can color the area between two curves on an Excel graph. We focus on coloring the area with only one color.
0:00 Excel Color Area between Two Curves – Intro 0:37 Creating a Line Chart and Adjusting its Appearance 1:40 Coloring the Area Between Two Curves 1:57 Defining Support and Difference Curves 3:13 Stacked Area Chart 4:02 Data Order Importance
You can see the return of a certain index over a year and the return of a portfolio that tries to replicate the index. We are interested in the difference between these curves, so we will make a graph of both curves and highlight the area between them.
We start by creating a graph with the two curves for the returns. To do this, we first select all data. Then, we navigate to “Insert”, and in the “Charts” section we select the line chart.
A graph appears with two curves: one for the index return and one for the portfolio return. The x-axis appears in the middle of our curves since it is located at the 0 y-value.
We will change this by clicking on the y-axis, navigating to the three bars icon and choosing the axis value where the horizontal axis crosses. We select “Axis value” and type -20 as this is well below both curves. We give the graph a name, I’ll take “Index vs Portfolio Return”.
Now we are ready to color the area between the curves. The idea is to make use of the stacked area chart. This chart fills the area under a curve, we name it support, and then for each additional curve, the area between this curve and the previous one is filled with a new color.
To create these additional stacked area elements on the chart, we first need to add two more columns of data. We start by defining the support curve and then we define the difference between both curves in order to color the area between the curves.
For the support curve, we choose one of both curves, let’s take the index return. Next, in the “Difference” column, we define the area that we need on top of the index return curve to obtain the portfolio return curve. To find it, we simply compute the difference between the portfolio return and index return. Remark that we do minus the index return, since this is the support curve.
Now we go back to our chart, select Chart Design, and click on Select Data. A menu opens where we will add the newly defined data columns. We click on Add, select the first column of data which is the support curve. We do the same for the Difference column.
As mentioned before, we want to make this extra data appear as stacked areas in the chart. To do this, we select Change Chart Type. In the menu, we select Combo. For both the index and portfolio returns, we choose line as before, and for the support and difference, we choose stacked area.
We press ... https://www.youtube.com/watch?v=kpROB9rcvrY
17827367 Bytes