3 Replies Latest reply on Sep 25, 2018 6:42 PM by Sing Yan Ang

# Differentiate Negative and Positive Values for Area Chart using Colours

Hello all!

I have a series of % difference plotted against month/year and I would like to differentiate the negative and positive values using colors. I created the following calculated field:

IF lookup([% Difference M2M Volume],0) < 0 THEN "Negative" ELSE "Postive" END and it seems to work on a bar chart.

However, what I hope to find out is if this is possible on a area chart too?

• ###### 1. Re: Differentiate Negative and Positive Values for Area Chart using Colours

You can do this using two area charts...Start by creating your area chart. Here's an example using Superstore:

Then create another axis using SUM(Profit):

Then color the charts as desired:

Then you'll need to fix the axes of each chart. For the one on the top, we'll fix it from 0 to some arbitrary number. In this case, I'm selecting 3000.

This will basically chop off the negative part of the chart. Now do the same with the bottom chart, setting it from 0 to some negative number. So that you don't have any scale issues, you should make the number the negative of the top value used in the top chart (i.e. 3000), so we'll go from 0 to -3000.

And now you'll have what you're looking for.

Hope this helps. I'm attaching a workbook.

• ###### 2. Re: Differentiate Negative and Positive Values for Area Chart using Colours

One other approach I've taken is to create a dual axis chart where one axis is an area chart in a sort of grey color and the other is a line that has been colored using your measure.

Then when you change this to a dual axis, you'll get something like this:

I like this because of the fact that you get gradient colors rather than just two discrete colors. If interested, I've attached the workbook.

• ###### 3. Re: Differentiate Negative and Positive Values for Area Chart using Colours

Thank you!