The Error Bar chart type consists of lines with markers that are used to display statistical information about the data displayed in a graph. A series of the Error Bar chart type has three Y values. While these values can be manually assigned to each point, in most cases, the values are calculated from the data present in another series. The order of the Y values is important because each position in the array of values represents a value on the error bar.
Series errorBarSeries = new Series(“ErrorBar”);
errorBarSeries.ChartType = SeriesChartType.ErrorBar;
errorBarSeries.MarkerBorderColor = Color.FromArgb(64, 64, 64);
errorBarSeries.MarkerSize = 6;
errorBarSeries.YValuesPerPoint = 3;
errorBarSeries.BorderColor = Color.FromArgb(180, 26, 59, 105);
errorBarSeries.Color = Color.FromArgb(252, 180, 65);
errorBarSeries.ShadowOffset = 1;
errorBarSeries.MarkerStyle = MarkerStyle.None;
errorBarSeries[“PointWidth”] = “0.1”;
double error = 100;
foreach (DataPoint point in Series1.Points)
{
double centerY = point.YValues[0];
double lowerErrorY = centerY – error;
double upperErrorY = centerY + error;
errorBarSeries.Points.AddXY(point.XValue, centerY, lowerErrorY, upperErrorY);
}
Chart1.Series.Add(errorBarSeries);