FastLine points being drawn outside chart area

TeeChart for ActiveX, COM and ASP
Post Reply
sjhein
Newbie
Newbie
Posts: 5
Joined: Wed Feb 08, 2006 12:00 am

FastLine points being drawn outside chart area

Post by sjhein » Thu Feb 23, 2006 1:41 am

I am using Using TeeChart Pro 7.0.0.6 with FastLine series. When I set AutoSizeVertAxis=false and zoom into the series while new points are still being added via AddRealTime, any new points that fall outside the chart area are still being painted onto the panel on top of chart titles, legends, etc. I have set ClipPoints=True, but that doesn't seem to make a difference. Is this an artifact of using the FastLine approach?

Thanks,
-Scott

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Feb 27, 2006 1:22 pm

Hi Scott,
I cannot reproduce the problem using the following code :

Code: Select all

Private Sub Check1_Click()
With TChart1
    .Series(0).asFastLine.AutoSizeVertAxis = Check1.Value
    If .Series(0).asFastLine.AutoSizeVertAxis = False Then
        .Axis.Left.SetMinMax 30, 70
        .Repaint
    End If
End With
End Sub

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = False
    .AddSeries scFastLine
    .Series(0).XValues.DateTime = True
    
    .Axis.Bottom.Labels.Angle = 90
    .Axis.Bottom.Labels.DateTimeFormat = "hh:mm:ss"
    
    .Series(0).asFastLine.AddRealTime Now, Rnd * 100
    .Axis.Bottom.SetMinMax Now - 8 / 86400, Now + 2 / 86400
    
    .TimerEnabled = True
    .TimerInterval = 1000
End With
Check1.Value = 1
End Sub

Private Sub TChart1_OnAfterDraw()
Check1_Click
End Sub

Private Sub TChart1_OnTimer()
With TChart1
    .Series(0).asFastLine.AddRealTime Now, Rnd * 100
    .Axis.Bottom.SetMinMax Now - 8 / 86400, Now + 2 / 86400
End With
End Sub
Could you please modify and post it here so I can reeproduce the problem here ?

sjhein
Newbie
Newbie
Posts: 5
Joined: Wed Feb 08, 2006 12:00 am

Post by sjhein » Mon Feb 27, 2006 5:15 pm

Pep wrote:Hi Scott,
I cannot reproduce the problem using the following code :

Code: Select all

Private Sub TChart1_OnTimer()
With TChart1
    .Series(0).asFastLine.AddRealTime Now, Rnd * 100
    ' .Axis.Bottom.SetMinMax Now - 8 / 86400, Now + 2 / 86400
End With
End Sub
Could you please modify and post it here so I can reeproduce the problem here ?
If you comment out the .Axis.Bottom.SetMinMax statement in the OnTimer event, you should be able to reproduce the problem.

Thanks for your help,
-Scott

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Mar 02, 2006 7:59 am

Hi Scott,

yes, you're correct, to solve it you can do :

Code: Select all

Private Sub TChart1_OnSeriesBeforeAdd(ByVal SeriesIndex As Long, MoreValues As Boolean)
TChart1.Canvas.ClipRectangle TChart1.Axis.Left.Position, TChart1.Axis.Top.Position, TChart1.Axis.Right.Position, TChart1.Axis.Bottom.Position
End Sub

sjhein
Newbie
Newbie
Posts: 5
Joined: Wed Feb 08, 2006 12:00 am

Post by sjhein » Thu Mar 02, 2006 7:25 pm

Pep wrote:Hi Scott,

yes, you're correct, to solve it you can do :

Code: Select all

Private Sub TChart1_OnSeriesBeforeAdd(ByVal SeriesIndex As Long, MoreValues As Boolean)
TChart1.Canvas.ClipRectangle TChart1.Axis.Left.Position, TChart1.Axis.Top.Position, TChart1.Axis.Right.Position, TChart1.Axis.Bottom.Position
End Sub
This work around seems to solve the problem. Thanks for your help.

-Scott

Post Reply