Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim errorSeriesH As Styles.Error
Dim errorSeriesL As Styles.Error
With TChart1
.Aspect.View3D = False
errorSeriesH = DirectCast(.Series.Add(New Styles.Error(.Chart)), Styles.Error)
errorSeriesL = DirectCast(.Series.Add(New Styles.Error(.Chart)), Styles.Error)
errorSeriesH.ErrorStyle = Styles.ErrorStyles.Top
errorSeriesL.ErrorStyle = Styles.ErrorStyles.Bottom
.Axes.Left.Automatic = False
.Axes.Left.Maximum = 6
.Axes.Left.Minimum = -6
End With
errorSeriesH.Add(1, 2, CorrectErrorValue(2, 0.2))
errorSeriesH.Add(2, 3, CorrectErrorValue(3, 1))
errorSeriesH.Add(3, -2, CorrectErrorValue(-2, 0.2))
errorSeriesH.Add(4, -3, CorrectErrorValue(-3, -1))
errorSeriesL.Add(5, 2, CorrectErrorValue(2, 0.2))
errorSeriesL.Add(6, 3, CorrectErrorValue(3, 1))
errorSeriesL.Add(7, -2, CorrectErrorValue(-2, 0.2))
errorSeriesL.Add(8, -3, CorrectErrorValue(-3, -1))
[b]TChart1.Legend.Inverted = True[/b] ' this causes the error
End Sub
Result:
see attached image