I have multiple charts with the same series, so I want to write a code where I can just have 1 legend instead of having a legend per chart.
I felt the easiest way was to write a code where I can have the legend cover the entire chart area. However, i've run into a problem where the legend doesn't want to overlap the plot area.
I've played around with different top/left combinations and still seem to have the problem where the legend doesn't want to overlap the plot area. Is there a way, to have the legend position it self automatically to the top left corner of the chart area, and then set the width/height of the legend to the chart area?
Any help/input would be appreciated!
I felt the easiest way was to write a code where I can have the legend cover the entire chart area. However, i've run into a problem where the legend doesn't want to overlap the plot area.
Code:
With ChartObject.Chart
If ChartObject.Name = "Legends" Then
With ChartObject.Chart.Legend
.top = ?
.left = ?
.Width = chartwidth
.Height = chartheight
.Interior.ColorIndex = 2
.Font.Size =5
Else
.HasLegend = False
End If
End With
I've played around with different top/left combinations and still seem to have the problem where the legend doesn't want to overlap the plot area. Is there a way, to have the legend position it self automatically to the top left corner of the chart area, and then set the width/height of the legend to the chart area?
Any help/input would be appreciated!