Page 1 of 1

FastLine points being drawn outside chart area

Posted: Thu Feb 23, 2006 1:41 am
by 9530253
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

Posted: Mon Feb 27, 2006 1:22 pm
by Pep
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 ?

Posted: Mon Feb 27, 2006 5:15 pm
by 9530253
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

Posted: Thu Mar 02, 2006 7:59 am
by Pep
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

Posted: Thu Mar 02, 2006 7:25 pm
by 9530253
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