Page 1 of 1

Chart in visible area

Posted: Tue Jan 06, 2009 2:46 pm
by 13051032
How can i know if a chart is in viewable area of screen? I have several charts arranged in vertical manner and i am thinking that updating the cursor only the viewable charts will greatly reduce the lag in cursor movements. (Steema.TeeChart.TChart).IsAccessible property always return false for every chart when put in a loop.

The snippet of code is as follows:
Code:

Code: Select all

If CType(Panel2.Controls.Item(i), Steema.TeeChart.TChart).IsAccessible Then
CType(DestChart.Tools.Item(0), Steema.TeeChart.Tools.CursorTool).XValue = myXValue
End If 

Posted: Wed Jan 07, 2009 10:55 am
by narcis
Hi asupriya,

Yes, you can check if each chart is in the screen viewable area doing something like this:

Code: Select all

        Dim rect As New Rectangle(TChart1.Left, TChart1.Top, TChart1.Width, TChart1.Height)
        rect.IntersectsWith(ScreenRect)
ScreenRect could either be the full screen rectangle or WinForm rectangle.

Hope this helps!