Back to Devexpress

How to: Plot the Standard Error Bars Indicator on a Chart

windowsforms-117101-controls-and-libraries-chart-control-examples-chart-elements-how-to-plot-the-standard-error-bars-indicator-on-a-chart.md

latest1.5 KB
Original Source

How to: Plot the Standard Error Bars Indicator on a Chart

  • Nov 18, 2021

This example demonstrates how to plot Standard Error Bars on a chart.

To do this, add a StandardErrorBars object to the series view’s XYDiagram2DSeriesViewBase.Indicators collection.

csharp
private void FormOnLoad(object sender, EventArgs e) {
    series.ArgumentDataMember = "TimePoint";
    series.ValueDataMembers.AddRange(new string[] { "Temperature" });
    series.DataSource = GetData();
    PointSeriesView view = (PointSeriesView)chartControl.Series[0].View;
    view.Indicators.Add(new StandardErrorBars {
        Direction = ErrorBarDirection.Both,
        Name = "Standard Error",
        ShowInLegend = true
    });
}
vb
Private Sub FormOnLoad(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
    series.ArgumentDataMember = "TimePoint"
    series.ValueDataMembers.AddRange(New String() { "Temperature" })
    series.DataSource = GetData()
    Dim view As PointSeriesView = CType(chartControl.Series(0).View, PointSeriesView)
    view.Indicators.Add(New StandardErrorBars With {.Direction = ErrorBarDirection.Both, .Name = "Standard Error", .ShowInLegend = True})
End Sub

See Also

Error Bars