Page 1 of 1

Flashing a single point on a chart

Posted: Mon Oct 17, 2005 10:02 pm
by 9527833
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

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