Flashing a single point on a chart

TeeChart for ActiveX, COM and ASP
Post Reply
amueller
Newbie
Newbie
Posts: 30
Joined: Tue Jul 26, 2005 4:00 am

Flashing a single point on a chart

Post by amueller » Mon Oct 17, 2005 10:02 pm

Hello,

Is there a way to 'flash' a point on a chart when it doesn't meet specifications OR when it is the last point on the chart?

For example, If a point exceeds certain constraints, I would like to blink that point between blue and black to give the operator more of a quick visibility to errors.

Thanks!

Andrew

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 Oct 18, 2005 8:28 am

Hi Andrew,

Yes, you could do somethink like:

Code: Select all

Dim UT, LT, M, D, Current As Double

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 25
    
    M = TChart1.Series(0).YValues.Total / TChart1.Series(0).Count
    D = (TChart1.Series(0).YValues.Maximum - TChart1.Series(0).YValues.Minimum) / 4
    
    UT = M + D
    LT = M - D
End Sub

Private Sub Timer1_Timer()
    Blink_Points
End Sub

Private Sub Blink_Points()
    For i = 0 To TChart1.Series(0).Count - 1
        Current = TChart1.Series(0).YValues.Value(i)
        If ((Current > UT) Or (Current < LT) Or (i = TChart1.Series(0).LastValueIndex)) Then
            If TChart1.Series(0).PointColor(i) = vbBlue Then
                TChart1.Series(0).PointColor(i) = vbYellow
            Else
                TChart1.Series(0).PointColor(i) = vbBlue
            End If
        End If
    Next
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