How can I "align middle" the legend and plot area?

I'd like to vertically center align the plot area and the legend but can't 
select them at the same time.  Is it possible to do this or do I have to 
eyeball it? 
0
11/12/2007 4:11:01 PM
excel.charting 18370 articles. 0 followers. Follow

1 Replies
193 Views

Similar Articles

[PageSpeed] 38

Hi,

You can not select both the plotarea and the legend in order to align them.
If you use Right click > Chart Options > Legend > Bottom. The legend will 
align horizontally with the middle of the plot area.
You will have to eyeball the vertical alignment and the same for the plot 
area alignment.

Or you could use code. Uncomment line if you want the plotarea centered in 
chartobject.
Place code in a standard code module.

Sub x()

    With ActiveChart
        ' center align plotarea in chart object
'        .PlotArea.Left = (.ChartArea.Width - .PlotArea.Width) / 2
'        .PlotArea.Top = (.ChartArea.Height - .PlotArea.Height) / 2
        .Legend.Left = .PlotArea.InsideLeft + ((.PlotArea.InsideWidth - 
..Legend.Width) / 2)
    End With
End Sub

Cheers
Andy

-- 

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"StonyCreeker" <StonyCreeker@discussions.microsoft.com> wrote in message 
news:308C66A2-42CC-41F2-B971-ACF60EC67A02@microsoft.com...
> I'd like to vertically center align the plot area and the legend but can't
> select them at the same time.  Is it possible to do this or do I have to
> eyeball it? 

0
andy9699 (3616)
11/12/2007 4:46:49 PM
Reply:

Similar Artilces:

text box won't align middle
I've got a text box in one of my documents, i've set it to middle align (they all are), but this one doesn't - it looks to me like its top align... It's got a texture background (the same as the others), and the text is arial embossed... I've tried setting the margins to 0 and 0.1 (and whatever they were as a default)... Select the text box, Format, Paragraph, be certain all these settings are correct. Zero before and after. Could be the text box has some corruption going on. If you create a new box and paste the text into it, does it work? -- Mary Sauer MSFT MV...

How can I "align middle" the legend and plot area?
I'd like to vertically center align the plot area and the legend but can't select them at the same time. Is it possible to do this or do I have to eyeball it? Hi, You can not select both the plotarea and the legend in order to align them. If you use Right click > Chart Options > Legend > Bottom. The legend will align horizontally with the middle of the plot area. You will have to eyeball the vertical alignment and the same for the plot area alignment. Or you could use code. Uncomment line if you want the plotarea centered in chartobject. Place code in a standard code...