ErrorBar with min and max values
Posted: Fri Apr 13, 2012 10:33 am
Hi,
I am trying to add error bars to bar graphs presenting minimum and maximum. I understand that the upper and lower errorbar are always in equal size, and that makes sense charting errors. The distance between mean to minimum, and between mean and maximum are not always equal, in most cases unequal. So I declare two errorbars, upper and lower to chart maximum and minimum respectively. Unfortunetely, the two errorbars are displayed offset from each other. Is there a way to bring both in line?
Cheers
Oli
Here my code:
Dim ErrorbarMin As New Steema.TeeChart.Styles.Error()
Dim ErrorbarMax As New Steema.TeeChart.Styles.Error()
ErrorbarMax.Add(i, GraphData_Mean(i), GraphData_Max(i) - GraphData_Mean(i), labels(i))
ErrorbarMin.Add(i, GraphData_Mean(i), GraphData_Mean(i) - GraphData_Min(i), labels(i))
ErrorbarMax.Color = Color.Black
ErrorbarMax.HorizAxis = HorizontalAxis.Bottom
ErrorbarMax.ErrorPen.Visible = True
ErrorbarMax.ErrorPen.Width = 2
ErrorbarMax.ErrorPen.Color = Color.Black
ErrorbarMax.ErrorPen.Style = Drawing2D.DashStyle.Solid
ErrorbarMax.ErrorWidthUnits = ErrorWidthUnits.Percent
ErrorbarMax.ErrorWidth = 65
ErrorbarMax.ErrorStyle = ErrorStyles.Top
ErrorbarMax.Title = "Error bar, upper"
ErrorbarMin.Color = Color.Black
ErrorbarMin.HorizAxis = HorizontalAxis.Bottom
ErrorbarMin.ErrorPen.Visible = True
ErrorbarMin.ErrorPen.Width = 2
ErrorbarMin.ErrorPen.Color = Color.Black
ErrorbarMin.ErrorPen.Style = Drawing2D.DashStyle.Solid
ErrorbarMin.ErrorWidthUnits = ErrorWidthUnits.Percent
ErrorbarMin.ErrorWidth = 65
ErrorbarMin.ErrorStyle = ErrorStyles.Bottom
ErrorbarMin.Title = "Error bar, lower"
tChart.Series.Add(ErrorbarMax)
tChart.Series.Add(ErrorbarMin)
I am trying to add error bars to bar graphs presenting minimum and maximum. I understand that the upper and lower errorbar are always in equal size, and that makes sense charting errors. The distance between mean to minimum, and between mean and maximum are not always equal, in most cases unequal. So I declare two errorbars, upper and lower to chart maximum and minimum respectively. Unfortunetely, the two errorbars are displayed offset from each other. Is there a way to bring both in line?
Cheers
Oli
Here my code:
Dim ErrorbarMin As New Steema.TeeChart.Styles.Error()
Dim ErrorbarMax As New Steema.TeeChart.Styles.Error()
ErrorbarMax.Add(i, GraphData_Mean(i), GraphData_Max(i) - GraphData_Mean(i), labels(i))
ErrorbarMin.Add(i, GraphData_Mean(i), GraphData_Mean(i) - GraphData_Min(i), labels(i))
ErrorbarMax.Color = Color.Black
ErrorbarMax.HorizAxis = HorizontalAxis.Bottom
ErrorbarMax.ErrorPen.Visible = True
ErrorbarMax.ErrorPen.Width = 2
ErrorbarMax.ErrorPen.Color = Color.Black
ErrorbarMax.ErrorPen.Style = Drawing2D.DashStyle.Solid
ErrorbarMax.ErrorWidthUnits = ErrorWidthUnits.Percent
ErrorbarMax.ErrorWidth = 65
ErrorbarMax.ErrorStyle = ErrorStyles.Top
ErrorbarMax.Title = "Error bar, upper"
ErrorbarMin.Color = Color.Black
ErrorbarMin.HorizAxis = HorizontalAxis.Bottom
ErrorbarMin.ErrorPen.Visible = True
ErrorbarMin.ErrorPen.Width = 2
ErrorbarMin.ErrorPen.Color = Color.Black
ErrorbarMin.ErrorPen.Style = Drawing2D.DashStyle.Solid
ErrorbarMin.ErrorWidthUnits = ErrorWidthUnits.Percent
ErrorbarMin.ErrorWidth = 65
ErrorbarMin.ErrorStyle = ErrorStyles.Bottom
ErrorbarMin.Title = "Error bar, lower"
tChart.Series.Add(ErrorbarMax)
tChart.Series.Add(ErrorbarMin)