color is not working in VB.Net 2005 implementation

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
GWRI
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2003 5:00 am
Location: USA
Contact:

color is not working in VB.Net 2005 implementation

Post by GWRI » Mon Aug 21, 2006 4:50 pm

I am using TeeChart in a VB.Net 2005 application. All seems to be working fairly well, but I can't get the color of my line series to work. Below is the code I am using.

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
[/size][/code]

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 9:14 am

Hi GWRI,

It works fine for me here usint latest TeeChart for .NET v2 maintenance release available and this code:

Code: Select all

        TChart1.Series(1).Color = Drawing.Color.Red
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply