Back to Devexpress

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

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

latest1.8 KB
Original Source

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

  • Nov 18, 2021

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

To do this, add a StandardDeviationErrorBars object to the series view’s XYDiagram2DSeriesViewBase.Indicators collection. Use the StandardDeviationErrorBars.Multiplier property to define the multiplier by which the standard deviation value is multiplied before display.

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 StandardDeviationErrorBars {
        Multiplier = 0.5,
        Direction = ErrorBarDirection.Both,
        Name = "Standard Deviation",
        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 StandardDeviationErrorBars With {.Multiplier = 0.5, .Direction = ErrorBarDirection.Both, .Name = "Standard Deviation", .ShowInLegend = True})
End Sub

See Also

Error Bars