RobBroekhuis
Technical User
Hi all,
I'm trying to do the following:
I have an Excel x-y scatter chart, with time on the horizontal axis. The time spans several years, and I want to show the seasons on the chart as shaded areas, e.g. I'd like to put background shading in the area of the chart between 4/1/2001 and 6/30/2001. I have a fairly good idea what I could do in VBA to put rectangle objects onto the chart sheet, with absolute coordinates determined by a calculation using the chart size and x-axis spacing. That's not such a great way to go about it, though, because everytime the chart gets rescaled, the coordinates of the rectangle objects would have to be adjusted (and I don't think there are useful events to latch the code for doing that onto, so it would have to be triggered manually).
Is there some more elegant way of achieving the same result? I'm thinking perhaps a way of overlaying my chart onto a bar chart, or something else that automatically scales?
One other way, come to think of it, might be to "paint" the shaded area using an x-y line graph with a thick line weight. Very laborious, and probably slow, though.
Rob
I'm trying to do the following:
I have an Excel x-y scatter chart, with time on the horizontal axis. The time spans several years, and I want to show the seasons on the chart as shaded areas, e.g. I'd like to put background shading in the area of the chart between 4/1/2001 and 6/30/2001. I have a fairly good idea what I could do in VBA to put rectangle objects onto the chart sheet, with absolute coordinates determined by a calculation using the chart size and x-axis spacing. That's not such a great way to go about it, though, because everytime the chart gets rescaled, the coordinates of the rectangle objects would have to be adjusted (and I don't think there are useful events to latch the code for doing that onto, so it would have to be triggered manually).
Is there some more elegant way of achieving the same result? I'm thinking perhaps a way of overlaying my chart onto a bar chart, or something else that automatically scales?
One other way, come to think of it, might be to "paint" the shaded area using an x-y line graph with a thick line weight. Very laborious, and probably slow, though.
Rob