ChartWrapCount Property

Microsoft Office Web Components Object Model

ChartWrapCount Property

       

Returns or sets the number of charts that are placed horizontally or vertically before wrapping occurs. For a more complete discussion of layout and wrapping, see the Help topic for the ChartLayout property. Read/write Long.

expression.ChartWrapCount

expression   Required. An expression that returns a ChartSpace object.

Example

This example sets the ChartWrapCount and ChartLayout properties and then adds six additional charts to the specified chart workspace.

Sub AddCharts()
    Dim chtChart
    Dim chConstants
    Dim iCtr
     
    Set chConstants = ChartSpace1.Constants
    
    ' Set the Chartspace so that a row or column
    ' of charts is created for every two charts
    ' in the chartspace.
    ChartSpace1.ChartWrapCount = 2
    
    ' Set the chartpace so that the carts are laid our horizontally.
    ' Since this code adds six charts to the chartspace and the 
    ' ChrtWrapCount property has been set to wrap every two charts,
    ' then the code results in three rows of two charts.
    ChartSpace1.ChartLayout = chConstants.chChartLayoutHorizontal
    
    For iCtr = 1 To 6
        ' Add a chart to the chartspace.
        Set chtChart = ChartSpace1.Charts.Add
        
        ' Enable the chart title.
        chtChart.HasTitle = True
        
        ' Add a title to the chart that indicates the order
        ' in which the chart was created.
        chtChart.Title.Caption = "Chart # " & iCtr
        
        ' Specify that the chart is to be a line chart.
        chtChart.Type = chConstants.chChartTypeLine        
    Next    
End Sub