AfterLayout Event

Microsoft Office Web Components Visual Basic

Private Sub ChartSpace_AfterLayout( ByVal drawObject As ChChartDraw)

drawObject A ChChartDraw object. Use the methods and properties of this object to manipulate drawing objects on the chart.

Remarks

The AllowLayoutEvents property must be set to True in order to capture this event.

Example

This example uses the AfterLayout event to move the title for the first chart in Chartspace1 to the left side of the chart. It then moves the legend towards the top of the chart.

Private Sub ChartSpace1_AfterLayout(drawObject)

    ' Move the title to the left side of the chart.
    ChartSpace1.Charts(0).Title.Left = 1

    ' Move the legend towards the top of the chart.
    ChartSpace1.Charts(0).Legend.Top = 20

End Sub