controlling the zoom tool

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
LordWhorfin
Newbie
Newbie
Posts: 24
Joined: Wed Feb 22, 2006 12:00 am
Location: Flagstaff, Arizona, USA

controlling the zoom tool

Post by LordWhorfin » Wed Sep 12, 2007 5:04 pm

Hello,

I'm using the zoom tool as in the TeeChart .NET tutorial as follows..

'add zoom functionality

Dim zoomTool1 As Steema.TeeChart.Tools.ZoomTool = New Steema.TeeChart.Tools.ZoomTool(WebChart1.Chart)
CheckZoom(WebChart1)

End Sub
Private Sub CheckZoom(ByVal wChart As Steema.TeeChart.Web.WebChart)
Dim zoomedState As ArrayList = CType(Session((wChart.ID + "Zoomed")), ArrayList)
zoomedState = CType(wChart.Chart.Tools(1), Steema.TeeChart.Tools.ZoomTool).SetCurrentZoom(Request, zoomedState)
If (zoomedState Is Nothing) Then
Session.Remove((wChart.ID + "Zoomed"))
Else
Session.Add((wChart.ID + "Zoomed"), zoomedState)
End If
End Sub


Is there a way to make sure that the chart is zoomed all the way out (extent of the data) when you open a webpage? It looks like zoomState is stored in a session variable. Can I just make it equal to Nothing on page load? Or will that just kill the zoom feature?

cheers, Paul

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Sep 13, 2007 7:51 am

Hi Paul,

If you look at the example you'll see that the first time the OnLoad event is called the session variable doesn't exist and therefore the chart is initialized. You can manually remove the session variable if you want but be careful where you do that because you may break the zooming functionality.
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