How to build a Two Colour Area Chart in Tableau
How to build a Two Colour Area Chart in Tableau

Area charts, because they are single entities usually only appear in one colour. Sometimes you might want to colour your charts according their negative and positive values however and there is a way you can do this on an Area chart in Tableau.

For this example, we are going to look at dummy data from Superstore in the USA. We want to look at profits and losses over the course of twelve months in the sale of Bookcases.

First, we need to create two area charts by dragging the Order Date onto the Columns Shelf and then two SUM(Profits) pills onto the Rows shelf. These will default to Line Graphs and indeed we could apply the same trick to a Line Graph and have a similar outcome. Some would argue that the outcome might look better. But we will come back to that later.

We now have two Area Charts that look the same. We want to split and stack the profit on to the loss. We do this by editing each axis. First, right click on the top Profit and select Edit Axis.

In the window, select Fixed Range and write 0 in the Fixed Start. Click out of the window…

…and then go down to the second Area Chart. Again right click and choose Edit Axis. Choose Fixed in the Range but this time put 0 in the Fixed End.

Now you can see that they sit on top of each other. To change the colour, simply go over to the Marks Card and select the SUM(Profit) that you wish to colour.

It is probably best to change the name of the bottom chart to Loss. Again, this is quite easy and just involves right clicking on the relevant Axis, going into the window and changing the Axis Title to Loss.

For clarity sake, you can add Labels to the Chart too.

Some would argue that you might be better off switching to a Line Graph which might allow you to focus better on the monthly values.

That of course would be for you to decide but either way you can clearly show your profit and loss on the same chart but in two separate colours.

About The Information Lab

The Information Lab Ireland is at the forefront of creating a data-driven culture in Ireland.

As part of its vision, The Information Lab Ireland regularly hosts free events throughout the country to show how being data-driven can improve decision making and lead to a better understanding of the world around us. For more on these events please like us on Facebook, follow us on Twitter or catch up with us on LinkedIn