I am trying to set the line series to color red using the line:
QuickChart.Series(0).Color = System.Drawing.ColorTranslator.ToOle(Drawing.Color.Red),
But to no avail. I know this color works because I use it later on to color the pen around the zoom box object, but the series line color is not changing.
Any suggestions?
Code: Select all
Private Sub TBtnChart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TBtnChart.Click
'update the chart
Dim thisvalues(1, 1) As Object
thisvalues = GetValues(CurrentTS, "WCSDataCube_TimeSeries", Me.DBWorkSpace.PathName)
Dim thists As TimeSeries
For Each thists In CurrentWCS.TimeSeriesSet
If thists.TSID = CurrentTS Then
Me.CurrentTimeSeries = thists
thists.Data = thisvalues
End If
Next
If Me.CurrentTimeSeries Is Nothing Then Exit Sub
QuickChart.ClearChart()
QuickChart.RemoveAllSeries()
QuickChart.AddSeries(TeeChart.ESeriesClass.scLine)
QuickChart.Aspect.View3D = False
QuickChart.Header.Visible = True
Dim i As Integer
For i = 1 To UBound(Me.CurrentTimeSeries.Data, 1)
Dim thisdate As Double, thisval As Double
Dim thedate As Date
thedate = Me.CurrentTimeSeries.Data(i, 0)
thisdate = thedate.ToOADate()
thisval = Me.CurrentTimeSeries.Data(i, 1)
QuickChart.Series(0).AddXY(thisdate, thisval, "", 0)
Next i
With QuickChart.Series(0)
QuickChart.Series(0).XValues.DateTime = True
QuickChart.Series(0).Color = System.Drawing.ColorTranslator.ToOle(Drawing.Color.Red)
.Marks.Visible = False
.Title = Me.CurrentWCS.WCSID & " " & Me.CurrentTimeSeries.Variable
QuickChart.Header.Text.Add(CStr(.Title))
'.asLine.LinePen.Color = System.Drawing.ColorTranslator.ToOle(Drawing.Color.Red)
'.Color = System.Drawing.ColorTranslator.ToOle(Drawing.Color.Red)
End With
QuickChart.Legend.Visible = False
With QuickChart.Zoom
.Animated = True
.Brush.Style = TeeChart.EBrushStyle.bsFill20
.Brush.Color = System.Drawing.KnownColor.Yellow
.Pen.Style = TeeChart.EChartPenStyle.psDash
.Pen.Color = System.Drawing.ColorTranslator.ToOle(Drawing.Color.Red)
End With
End Sub