Page 1 of 1

controlling the zoom tool

Posted: Wed Sep 12, 2007 5:04 pm
by 9640386
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

Posted: Thu Sep 13, 2007 7:51 am
by narcis
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.