How do I change the color of the line in a line chart according to value?

stephenpoole4

New Member
Joined
Jul 19, 2017
Messages
2
I have a line chart that tracks "change per week."

Some weeks have negative values, some have positive values. Essentially, I want to specify parameters so that negative values are colored green, values near zero (possibly + or - 100) are orange, and positive values are red.

Is there a way to do this? My chart is a PivotChart, if that matters.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I don't think you can do that with a line chart without some VBA but without VBA you can get by using a stacked bar chart. You're going to need two value columns: One for the positive values and another one for the (minus) negative values ( = if you want your bars to go the same way you're going to have to show the negative values as positive values as well ). For three colors, you're going to need three columns etc.
 
Last edited:
Upvote 0
1. I wrote a tutorial, Conditional Formatting of Lines in an Excel Line Chart Using VBA, that shows how to do this with VBA.

2. You ought to consider a color scheme besides red and green, since 8% or so of the male population (and less than 0.5% of the female population) has color vision deficiencies that interfere with distinguishing between these colors. Blue and orange are generally color-vision-friendly.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top