menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartErrorBarSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartErrorBarSettings

    Specifies the configuration of the error bar.

    Inheritance
    System.Object
    ChartSubComponent
    ChartErrorBarSettings
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartErrorBarSettings : ChartSubComponent, ISubcomponentTracker, IChartElement

    Constructors

    ChartErrorBarSettings()

    Declaration
    public ChartErrorBarSettings()

    Properties

    Color

    Gets or sets the stroke color of the error bar.

    Declaration
    public string Color { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the color of the error bar's stroke, which accepts values in hex or rgba as valid CSS color strings.

    Remarks

    Changing this color will update the visual appearance of the error bars in the chart.

    Examples
    // This example demonstrates how to render a chart with error bars and set their color to red.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Color="red" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Direction

    Gets or sets the direction of the error bar.

    Declaration
    public ErrorBarDirection Direction { get; set; }
    Property Value
    Type Description
    ErrorBarDirection

    An ErrorBarDirection that specifies the direction of the error bar.

    • both: Renders error bars in both directions.
    • minus: Renders error bars in the negative direction.
    • plus: Renders error bars in the positive direction.
    Remarks

    Specifying the direction determines how the error bars are rendered on the chart, improving the visualization of data uncertainty.

    Examples
    // This example demonstrates how to render a chart with error bars shown only in the Plus direction.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Direction="ErrorBarDirection.Plus" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    ErrorBarCap

    Gets or sets the options for customizing the cap of the error bar.

    Declaration
    public ChartErrorBarCapSettings ErrorBarCap { get; set; }
    Property Value
    Type Description
    ChartErrorBarCapSettings

    An instance of ChartErrorBarCapSettings that defines the cap properties for the error bars.

    Remarks

    Utilize this property to customize the appearance of the caps at the ends of the error bars, adjusting attributes such as the style, size, and color to better visualize data points and uncertainty.

    Examples
    // This example demonstrates how to render a chart with error bars and custom cap settings.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true">
                    <ChartErrorBarCapSettings Length="10" Width="10" Color="#0000ff"></ChartErrorBarCapSettings>
                </ChartErrorBarSettings>
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    HorizontalError

    Gets or sets the horizontal error value of the error bar.

    Declaration
    public double HorizontalError { get; set; }
    Property Value
    Type Description
    System.Double

    A double that specifies the horizontal error value for the error bar. The default value is 1.

    Remarks

    Specifying the horizontal error value will determine the extent of the error bar in the horizontal direction, which is crucial for accurately representing the uncertainty in the data points.

    Examples
    // This example demonstrates how to render a chart with horizontal error bars.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" HorizontalError="5" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    HorizontalNegativeError

    Gets or sets the horizontal negative error value of the error bar.

    Declaration
    public double HorizontalNegativeError { get; set; }
    Property Value
    Type Description
    System.Double

    A double that specifies the horizontal negative error value for the error bar. The default value is 1.

    Remarks

    Specifying the horizontal negative error value will determine the extent of the error bar in the negative horizontal direction, which is essential for accurately representing the uncertainty in the data points.

    Examples
    // This example demonstrates how to render a chart with horizontal error bars and a negative error value.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Mode="ErrorBarMode.Horizontal" HorizontalNegativeError="1" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    HorizontalPositiveError

    Gets or sets the horizontal positive error value of the error bar.

    Declaration
    public double HorizontalPositiveError { get; set; }
    Property Value
    Type Description
    System.Double

    A double that specifies the horizontal positive error value for the error bar. The default value is 1.

    Remarks

    Specifying the horizontal positive error value will determine the extent of the error bar in the positive horizontal direction, which is vital for accurately representing the uncertainty in the data points.

    Examples
    // This example demonstrates how to render a chart with horizontal error bars and a positive error value.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Mode="ErrorBarMode.Horizontal" HorizontalPositiveError="1" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Mode

    Gets or sets the mode of the error bar.

    Declaration
    public ErrorBarMode Mode { get; set; }
    Property Value
    Type Description
    ErrorBarMode

    An ErrorBarMode that specifies the mode of the error bar.

    Remarks

    The available modes are Vertical, Horizontal, and Both.

    Examples
    // This example demonstrates how to render a chart with error bars in horizontal mode.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Mode="ErrorBarMode.Horizontal" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Type

    Gets or sets the type of the error bar.

    Declaration
    public ErrorBarType Type { get; set; }
    Property Value
    Type Description
    ErrorBarType

    An ErrorBarType that specifies the type of the error bar.

    Remarks

    The available types are Fixed, Percentage, StandardDeviation, StandardError, and Custom.

    Examples
    // This example demonstrates how to enable error bars of type 'Percentage' in a chart series.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Type="ErrorBarType.Percentage" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    VerticalError

    Gets or sets the vertical error value of the error bar.

    Declaration
    public double VerticalError { get; set; }
    Property Value
    Type Description
    System.Double

    A double that specifies the vertical error value for the error bar. The default value is 1.

    Remarks

    Specifying the vertical error value will determine the extent of the error bar in the vertical direction, which is essential for accurately representing the uncertainty in the data points.

    Examples
    // This example demonstrates how to vertical error width in a chart series.
    <SfChart>
        <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
        <ChartSeriesCollection>
            <ChartSeries DataSource="@SalesReports" XName="X" YName="Y" Type="ChartSeriesType.Line">
                <ChartErrorBarSettings Visible="true" Type="ErrorBarType.Percentage" VerticalError="4" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    VerticalNegativeError

    Gets or sets the vertical negative error value of the error bar.

    Declaration
    public double VerticalNegativeError { get; set; }
    Property Value
    Type Description
    System.Double

    A double that specifies the vertical negative error value for the error bar. The default value is 3.

    Remarks

    Specifying the vertical negative error value will determine the extent of the error bar in the negative vertical direction, which is crucial for accurately representing the uncertainty in the data points.

    Examples
    // This example demonstrates how to render a chart with vertical error bars and a negative error value.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Mode="ErrorBarMode.Vertical" VerticalNegativeError="1" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    VerticalPositiveError

    Gets or sets the vertical positive error value of the error bar.

    Declaration
    public double VerticalPositiveError { get; set; }
    Property Value
    Type Description
    System.Double

    A double that specifies the vertical positive error value for the error bar. The default value is 3.

    Remarks

    Specifying the vertical positive error value will determine the extent of the error bar in the positive vertical direction, which is essential for accurately representing the uncertainty in the data points.

    Examples
    // This example demonstrates how to render a chart with vertical error bars and a positive error value.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Mode="ErrorBarMode.Vertical" VerticalPositiveError="1" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Visible

    Gets or sets a value indicating whether the error bar is visible.

    Declaration
    public bool Visible { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean indicating if the error bar is visible. The default value is false.

    Remarks

    Specifying the visibility of the error bar allows users to control whether the error bars are displayed on the chart.

    Examples
    // This example demonstrates how to enable error bars for a chart series.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true">
                </ChartErrorBarSettings>
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Width

    Gets or sets the stroke width of the error bar.

    Declaration
    public double Width { get; set; }
    Property Value
    Type Description
    System.Double

    A double representing the width of the error bar's stroke. The default value is 1.

    Remarks

    Specifying the stroke width of the error bar allows users to adjust the visibility and prominence of the error bars on the chart, enhancing the overall readability of the data representation.

    Examples
    // This example demonstrates how to render a chart with error bars having a specific width.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
                <ChartErrorBarSettings Visible="true" Width="4" />
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved