Display 2 Category Labels on The Same Axis

HarlanJ

New Member
Joined
Feb 13, 2008
Messages
16
Hey there,

I have a vba procedure that determines the size of a dataset collected from another source, processes it, and builds embedded control charts for the user to view. All the formatting is set by code as well as the additon of the data series and labels. The graphs are set up right now to display the data on a line chart with a time-scale category axis. The category labels are set to named divisions of time (such as a shift colour) and are displayed after every 2nd tick mark. The categories have a predefined width, and the chart is made to widen as more datapoints are plotted.

What I'm trying to do now, is to display a second set of labels below (or above) the first on the same axis. These labels would denote the date on which the original labels fall (ex. Red shift - Jun 23).

I've found that Excel will do this to some extent just by selecting two rows containing the desired labels and setting those as the category labels (through Chart->source data). However, selecting the information this way causes Excel to "forget" the original tick mark spacing and labels, as well as extending the tick marks down to the bottom of the labels.

ie.
|---'---|---'---|---'---|---'---
Red _ _ Blue _ _ Green_ Red

Vs.
|---|---|---|---|---|---|---|---
|Jun| _ |Jun| __|Jun| _ |Jun|
|01 _ _ | 02 _ _ | 03 _ _| 04
| _ _ _ | _ _ _ _| _ _ _ _|
| Red _ | Blue _ | Green | Red

The date label gets compressed into representing only the first tick mark whereas the shift colour is spaced evenly between two. I'd like to have them both spaced evenly across the categories.

I can just turn off the tick marks and eliminate the lines, but this defeats the purpose of having them in the first place. Is there a way to programatically show both labels in the same fashion? The first label is set already through VBA from a range.

The end result would look like this:

|---'---|---'---|---'---|---'---
Red _ _ Blue _ _Green _Red
Jun 01 _Jun 02 _Jun 03 Jun04
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

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