ChErrorBarsCollection Object

Microsoft Office Web Components Visual Basic

ChErrorBarsCollection Object

ChSeries ChErrorBarsCollection
Multiple objects

The collection of ChErrorBars objects for a single series.

Using the ChErrorBarsCollection object

The ChSeries object’s ErrorBarsCollection property returns a ChErrorBarsCollection object.

The following example adds error bars to the first series in the first chart in ChartSpace1, then sets the properties for the error bars.

Sub AddErrorBars()

    Dim chConstants
    Dim ebCollection
    Dim ebSeries1

    Set chConstants = ChartSpace1.Constants

    ' Set a variable to the collection of error bars for
    ' the first series in the first chart of Chartspace1.
    Set ebCollection = ChartSpace1.Charts(0).SeriesCollection(0).ErrorBarsCollection

    ' Add error bars to the chart.
    ebCollection.Add

    ' Set a variable to the error bars for the data series.
    Set ebSeries1 = ebCollection.Item(0)

    ' Set the error bars so that they represent a certain
    ' percentage of the value of a data point.
    ebSeries1.Type = chConstants.chErrorBarTypePercent

    ' The error bars represent 5% of a data point.
    ebSeries1.Amount = 0.05

End Sub