WebForm Chart Events
Posted: Fri Dec 05, 2008 5:20 pm
Regarding events it states in the user guide:
If I omit the lines below that add the scroll tool and set the WebCharts Autopostback property to True then the WebChart1_ClickBackground and WebChart1_ClickTitle events fire ok. However, if I include the lines that add the scroll tool they never do (irrespective of whether Autopostback is true or false). From my understanding of the above when the scroll tool is present the click response should be automatically activated and a postback should occur?Using Interactive Chart events (AutoPostback property True when no WebChart Tools in Chart)
Load events and runtime interactive events that respond to user mouseclicks on the Chart may be used with TeeChart's WebChart. No special action needs to be taken to use a paint event such as 'AfterDraw', one can select the Chart event from the Property browser eventlist. If no TeeChart WebChart Tool such as Zoom, Scroll or Hotspot is present in the Chart you should set the AutoPostback property to True to enable interactive (user click) events. If the aforementioned Tools are present click response is automatically activated. For interactive events, the Chart will respond to user mouseclick events posting back the information of where the click has occurred to the server whereupon your serverside code can act upon the event. The event you wish to use may then be selected for coding from the property browser eventlist.
Code: Select all
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Add series - code omitted for brevity
' Add scroll tool
Dim scrollTool As New Steema.TeeChart.Tools.ScrollTool(WebChart1.Chart)
scrollTool.SegmentViewUnits = Steema.TeeChart.Tools.ScrollToolViewUnit.percent
scrollTool.ViewSegmentSize = 10
scrollTool.StartPosition = 10
End Sub
Protected Sub WebChart1_ClickBackground(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles WebChart1.ClickBackground
Response.Write("WebChart1_ClickBackground Fired")
End Sub
Protected Sub WebChart1_ClickTitle(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles WebChart1.ClickTitle
Response.Write("WebChart1_ClickTitle Fired")
End Sub