EndStyle Property

Microsoft Office Web Components Visual Basic

Returns or sets the end style for error bars. Read/write ChartEndStyleEnum .

expression.EndStyle

expression    Required. An expression that returns a ChErrorBars object

Example

This example adds error bars to all of the series in the first chart in ChartSpace1 and then sets the error amount and end style.

Sub Add_Error_Bars()
    Dim ebErrorBars
    Dim serChartSeries
    Dim chConstants

    Set chConstants = ChartSpace1.Constants

    ' Loop through all of the series in the first chart
    ' in ChartSpace1. 
    For Each serChartSeries in ChartSpace1.Charts(0).SeriesCollection

        ' Add error bars to the current series.
        Set ebErrorBars = serChartSeries.ErrorBarsCollection.Add

        ' Set the error bars to be a percentage of the value.
        eberrorBars.Type = chConstants.chErrorBarTypePercent
        
        ' Set the percentage amount.
        ebErrorBars.Amount = 0.05
        
        ' Set the end style of the error bars.
        ebErrorBars.EndStyle = chConstants.chEndStyleNone
    Next
End Sub