Amount Property

Microsoft Office Web Components Object Model

Amount Property

       

Returns or sets the error amount for fixed-value and percentage error bars. You specify data-bound error bar amounts by using the SetData method. Read/write Double.

expression.Amount

expression   Required. An expression that returns a ChErrorBars object.

Remarks

This value is mathematically correct, meaning that 5% is represented as 0.05 and not 5. An error bar with the fixed amount of 5 will become 500% when changed to a percentage.

Example

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

Sub Add_Error_Bars()
    Dim ebErrorBars
    Dim serChartSeries
    Dim chConstants

    Set chConstants = ChartSpace1.Constants

    ' Loop through all of the series in the first chart
    ' of 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
    Next
End Sub