# Number-based Gradient Fill for Excel bar chart

1. ## Number-based Gradient Fill for Excel bar chart

Thanks in advance for any assistance.

I've learned the basics of the gradient fill option within an excel chart and was able to get it to work in the following way for a bar chart:
Values in series range from 0% to 100%(for this example, 25%, 50%, 75%, and 100%), and y axis scale also goes from 0% to 100%.
I currently am using gradient fill across the bars so each bar changes color from green to red as you move up the bar.
So the 25% bar which starts at the x-axis (0%) and moves up to 25%, shows a smooth transition from green to red as you move up the bar, so 0% is green and 25% is red.
Similarly, the 50% bar which starts at the x-axis (0%) and moves up to 50%, shows a smooth transition from green to red as you move up the bar, so 0% is green and 50% is red.
Similarly, the 100% bar which starts at the x-axis (0%) and moves up to 100%, shows a smooth transition from green to red as you move up the bar, so 0% is green and 100% is red.

What I would like to do next is to have the coloration gradient be decided by the actual value instead of how far up the bar it is. 0% of value would be green and 100% of value would be red and 50% would be halfway between green and red(let's say orange). I want to see the following results after this change:
In my first example, the 25% bar which starts at the x-axis (0%) and moves up to 25% would transition from green to a lighter green, maybe approaching orange, but would never reach red, because it's value never reached 100%
In my second example, the 50% bar which starts at the x-axis (0%) and moves up to 50% would transition from green to orange, but would never reach red, because it's value never reached 100%
In my third example, the 100% bar which starts at the x-axis (0%) and moves up to 100% would transition from green to red. (this is the only one that would match the gradient colors of the original chart.

I found a software called grapher which appears to do this but I need to accomplish within excel if possible. Any help would be appreciated.

2. ## Re: Number-based Gradient Fill for Excel bar chart

The example chart is created using a combination of chart types and additional data, driven by formula.

use a series of 100% bars to provide the graduation colour

2 series, as stacked bar, to both reveal and mask the colour fill.
The actual data bar has no fill.
The pad data bar has fill to match plot area colour.

The secondary axis are still visible so you can see how chart is constructed. This can be hidden by formatting no axis labels.

3. ## Re: Number-based Gradient Fill for Excel bar chart

Thanks so much. Solution is perfect. I knew there was a way.

There are currently 1 users browsing this thread. (0 members and 1 guests)