Adding a horizontal bar in Excel

Tuesday, May 6, 2014

This is one of those things you just think should be easy (one line of code in R!) and turns out to be not quite so simple!! The solution was culled from this page and this page. The “work around” is to utilise the secondary y-axis in Excel to show two values that are the same, scaled from 0 to 1, then hide the axis labels. The quick steps to this are:

1. Create a dummy series such as
0 865
1 865

2. Goto Chart Source Data: add this as a new series (x: 865 points, y: 0 1 points)

3. Goto to Format Data Series (double click on the line itself): goto the Axis tab and click Secondary axis. This will assign it to a secondary *y-axis”

4. Goto Chart Options: click the Axes tab and, voila, both secondary x and y axis options are available. For the secondary axis tick x-axis

5. Scale Axes: for the secondary x axis (double click the axis itself) goto the Scale tab and make sure it goes from a minimum of 0 to a maximum of 1. For the secondary y axis goto the Scale tab and make sure it matches the scale of the primary y axis.

6. Format Axes: for *both* secondary axes goto the Patterns tab and make sure that all tick mark types/labels are set to none in order to turn the labeling off. On the Scale tab untick “Value (Y) axis crosses at maximum category” and “Value (Y) axis crosses between categories”

That should do it - tested in my latest version of Microsoft Excel - yes, 2003!!

Add comment

Fill out the form below to add your own comments