Creating an Area chart

In a very simplistic way, an Area chart is a stacked line chart. It is an essentially a line chart where the space between each line and the next line is filled with a color. These charts are typically used to show the relative proportions of totals or percentage relationships. This type of chart is not the best way to show specific values along the line, but it can clearly show the total values so you can get an idea of how a dimension contributes to an overall trend.

Getting ready

The Area chart is an extension of the Line Chart and hence we will work on the line chart that we created earlier. In the Line chart recipe, we showed the profit for every month over the last four years. For the Area Chart, we will show the sales for every month over the last four years. Let's see how this is done.

How to do it…

  1. While on the Line chart sheet, let us right-click on the sheet name and select the Duplicate sheet option. We will get a new sheet; rename it to Area chart.
  2. We will then remove the Profit field in the Rows shelf by dragging it from the Rows shelf and dropping it outside the view in the gray area or by simply clicking on the dropdown and selecting the Remove option. Refer to the following image:
    How to do it…
  3. Next, let us drag Sales from the Measures pane and drop it into the Rows shelf. After we do this, we will then drag Segment from the Dimensions pane and drop it into the Color shelf. We will then get the view as shown in the following image:
    How to do it…
  4. Then, we will change the mark from Line to Area by selecting the Area mark in the Marks dropdown in the marks card. Refer to the following image to see the desired output:
    How to do it…

How it works…

When we get Segment in the Color shelf and change Marks to Area, we stack up the line chart. When we do this, we will notice a change in Value of Axis for the line chart and the area chart.

This is because, in the Line chart, we show the sales per segment; however, in the Area chart, the Sales value is stacked up to show the total sales for all the segments together. The area shows the trend of sales for each segment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.52.188