How to change color in FastLine series

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

How to change color in FastLine series

Post by David » Mon May 22, 2006 6:42 am

Hi,

I am trying to set a threshold value for Y and if Y exceeds the threshold, the data should be added in red color. Otherwise, add data in green color. How to realize it for FastLine series?

Thank you very much!

David

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

Post by Narcís » Mon May 22, 2006 9:09 am

Hi David,

This can not be done using a fast line series. Fast line only supports a unique color. However, you can do it by using a line series and something like this:

Code: Select all

Private Sub Form_Load()
    Dim val, threshold As Double
    
    threshold = 0.8
    
    With TChart1.Series(0)
        .ColorEachPoint = True

        For i = 0 To 100
            val = Rnd
            
            If val > threshold Then
                .Add Rnd, "", vbRed
            Else
                .Add Rnd, "", vbGreen
            End If
        Next
    End With
End Sub
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