Skip to main content

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

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

To do this, add a PercentageErrorBars object to the series view XYDiagram2DSeriesViewBase.Indicators collection. Then, define the percentage of error values using the PercentageErrorBars.Percent property.

private void FormOnLoad(object sender, EventArgs e) {
    this.productsTableAdapter.Fill(this.nwindDataSet.Products);
    PointSeriesView view = (PointSeriesView)chartControl.Series[0].View;
    view.Indicators.Add(new PercentageErrorBars {
        Percent = 10,
        Direction = ErrorBarDirection.Both,
        ShowInLegend = true,
        Name = "Units on Custom Order"
    });
}
See Also