Peltier Tech Blog

Excel Chart Add-Ins | Training | Custom Solutions | Charts and Tutorials | PTS Blog

 

Main menu:

 
Peltier Tech
Chart Add-Ins

Peltier Tech Waterfall Chart Utility
Peltier Tech Cluster-Stack Chart Utility
Peltier Tech Box and Whisker Chart Utility
Peltier Tech Marimekko Chart Utility
Peltier Tech Dot Plot Utility
Peltier Tech Cascade Chart Utility

 
Excel Dashboards

Subscribe

Site search

Subscribe

Site search


Recent Posts

Recently Commented

Popular Posts

Archive


 

Categories


 

Privacy Policy

Creative Commons License
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Horizontal Bands in the Background of an Excel 2007 Chart

by Jon Peltier
Wednesday, August 19th, 2009
Peltier Technical Services, Inc., Copyright © 2010.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

In Horizontally Banded Chart Background I showed how to create colored horizontal bands in the background of a chart.

Horizontal Band Background Chart Step 8

I first wrote up that tutorial back when I was using Excel 97, and the protocol remained the same for Excel versions through Excel 2003. The protocol is pretty much the same in Excel 2007, too, but the rearrangement of the interface into the Office 2007 ribbon has made the old instructions difficult to follow.

Let’s use the same data as in the previous example (with recent dates). This is the data for the main series of values in the chart. The average and standard deviation for the values in B5:B21 are displayed in B1 and B2.

Data for Horizontal Band Background Example

The data for the bands is given below. We’ll use stacked area type series. The value in E2 is three sigma below the mean, so the formula in E2 is =$B$1-3*$B$2. The thickness of each remaining band is one standard deviation, so the formula in F2:K2 is =$B$2. The formula in E3 is =E2, and this is copied and pasted into F2:K2.

Statistics for Horizontal Band Background Example

The data in A4:B21 is used to make a simple line chart. The Y axis min and max limits have been set to fixed  values of 0 and 22, so they don’t change as we’re adding and formatting the rest of the series.

Horizontal Band Background Chart Step 1

Copy D1:K3, select the chart, and use Paste Special to add the data as new series, with data in columns, categories in the first column (but don’t replace existing categories), and series names in the first row.

These series are added as line chart type series, but we can’t see them (In 2003 we could, so the next step was easier). The values 0 and 1 on the time scale axis are plotted off scale, so we will move the series to the secondary axis. We can’t click on the series to format them, so we have to use the Chart Element control to select them. This control is present at the left edge of the Layout and Format tabs, the last two Chart Tools tabs.

Chart Element Control on Chart Tools Tabs

All of the chart elements are listed in this dropdown control. You can select the hidden series using this control.

Selecting a Series Using the Chart Element Control

One by one, select one of these new series, press Ctrl+1 to open the Format Series dialog, and on the first tab you see, select the Secondary Axis option. The line chart series are now visible. The lower series shows the -3 SD data The upper series is really all of the other added series, which coincide because the Y values are all the same.

Horizontal Band Background Chart Step 2

When Excel assigns a series to the secondary axis, often it only adds a secondary value (Y) axis, which we see at the right edge of the chart. We need the secondary category (X) axis to make the background work. On the Chart Tools – Layout tab, click the Axes dropdown (near the middle of the tab), select Secondary Horizontal Axis, and choose the Show Left to Right Axis option. (Why does it feel like they’ve dumbed it down a little too far?)

One of the changes in Excel 2007 that decimates productivity and efficiency is that you cannot use the F4 key (shortcut for Repeat Last Action) here. In 2003 you could assign one series to the secondary axis, then select another series using the arrow keys and press F4 to quickly assign is to the secondary axis.

Horizontal Band Background Chart Step 3

We want the 0 and 1 of this secondary axis to extend to the edges of the chart, but we have to wait until after the next step.

We also want to convert the line chart series into stacked area chart series. One by one, select each added series by right clicking, and choose Chart Type from the pop up menu. Select the Stacked Area subtype of the Area Chart type. Do this seven times to get the stacked colored bands.

Here is another situation in which you cannot use the F4 Repeat Last Action shortcut. In 2003 you could change the chart type of one series, then select another series using the arrow keys and press F4 to quickly change it to the same chart type.

Horizontal Band Background Chart Step 4

Now we can fix the secondary category (X) axis. Select the axis, press Ctrl+1 to open the Format Axis dialog, and at the bottom of the first tab you see, select the On Tick Marks option for Position Axis.

Horizontal Band Background Chart Step 5

Now let’s clean up the axes. Format the secondary category (X) axis so that no parts of it are visible: choose None for major and minor tick mark type and for axis labels, all on the first tab, Axis Options. On the Line Color tab, choose No Line. Select the secondary value (Y) axis and press Delete. This forces the stacked area series to use the primary value (Y) axis. Format the dates in the primary category (X) axis so they are easier to read.

Horizontal Band Background Chart Step 6

Those colors have to go. Here is the chart with stacked area series fills formatted with the Standard Colors in the Chart Tools – Format tab’s Shape Fill dropdown. The lowest area series is formatted with no fill, and the plot area is filled with red.

Horizontal Band Background Chart Step 7

Those are a little too bold, so use the More Fill Colors option to tone down the fills. I used the Standard Colors as a basis, then on the Custom tab of the Colors dialog, switched to the HSL color model, and changed the Luminosity setting to a higher number in the range of 180 to 200.

Horizontal Band Background Chart Step 8



Related Posts:

Bookmark and share this entry:
  • Twitter
  • Digg
  • Facebook
  • LinkedIn
  • del.icio.us
  • Technorati
  • StumbleUpon
  • Google Bookmarks
  • Reddit
  • MySpace
  • Slashdot
  • Yahoo! Buzz
  • Tumblr

Learn how to create Excel dashboards.

Comments


Comment from Amy
Time: Saturday, October 17, 2009, 11:13 pm

Hi Jon – I was able to use this to set up the horizontal bands perfectly. However, in addition to the bands on the secondary axis, I also plotted some data that I would like to trend.

My chart is set up as follows:

primary x axis – quarterly net income results (4 points) refecting 2008 and 2009 data
secondary x axis – horizontal bands to reflect tolerances (12 points)

This has worked great. The problem arises when I try to forecast the remainder of 2009. I would like to forecast based on the monthly data points I have (which is why the secondary axis is based on 12 points) I added this data and had this data be reflected as a line graph (vs the area stacked data which is currently on the secondary axis). I can add the trend and it works…until I save the file and close out. When I go back into the graph, my trend is still there but the projection is different – almost like it is taking into account different data.

I would be glad to provide the set up of my data and chart if needed, would really appreciate any help you could provide.

Thanks!


Comment from Jon Peltier
Time: Wednesday, October 21, 2009, 10:13 pm

Amy sent me her file, and I checked it out.

Amy’s trendline was based on 12 months of X data and 8 months of Y data. Big deal, right? In 2003 it is no big deal, but in 2007 this seems to confuse the trendline.

When I extended the Y values to include four blank cells, the trendline still was goofed up. It turns out the chart was treating blank cells as zeros, and the trendline had a crazy slope to fit the four zeros at the end of the series. When I changed the setting to leave a gap in place of empty cells, the trendline behaved as expected.


Comment from Joe Moore
Time: Wednesday, March 24, 2010, 12:34 pm

Hi Jon: Great Site by the way! I am doing a much more simpler graph than the above. In my case the secondary axis is y-axis vs x-axis. When I switch to the secondary axis and then Format Axis and for Position Axis I Selected On Tick Marks, the graph lines extends to the Left axis but does not extend on the right side. The result of this is when I switch my secondary axis lines graphs to area graphs there is a column of white space on the right side of the Plot area, this exists whether or not I delete the secondary y-axis or not. I am using Windows Vista (however behavior was also seen on XP) and Excel 2007. When I save file as Excel 2003 and run it under Excel 2003 it works perfect. An basic example of simple chart’s data is below:
FY Amt Area
FY10 1 70%
FY11 4 70%
FY12 5 70%
FY13 7 70%

FY is Primary x-Axis, Amount is Line Graph, Area is Area Graph. I would appreciate it if you could point either a solution or tell me what I am doing wrong.

Thanks,

Joe

Write a comment

I welcome comments from my readers. If you have an opinion on this post, if you have a question or if there is anything to add, I want to hear from you. Whether you agree or disagree, please join the discussion.

If you want to include an image in your comment, post it on your own site or on one of the many free image sharing sites, and include a link in your comment. I'll download your image and insert the necessary html to display the image inline.

Read the PTS Blog Comment Policy.





Subscribe without commenting

Peltier Tech Waterfall Chart Utility Peltier Tech Cluster-Stack Chart Utility Peltier Tech Box and Whisker Chart Utility Peltier Tech Marimekko Chart Utility Peltier Tech Dot Plot Utility Peltier Tech Cascade Chart Utility

Create Excel dashboards quickly with Plug-N-Play reports.