WebForm Chart Events

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

WebForm Chart Events

Post by norman » Fri Dec 05, 2008 5:20 pm

Regarding events it states in the user guide:
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.
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? :?

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

Marc
Site Admin
Site Admin
Posts: 1266
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Dec 09, 2008 3:08 pm

Hello,

The text in the help section you have found is misleading. Our apologies for that, we'll correct it for the next update release. Whilst true for the ZoomTool, when the ScrollTool is active conventional click events may not be used. Scrolltool allows the possibility to drag on mousedown and feedback of any mouseover information would need to be taken via the Hotpsot tool, in a similar way to the ASP.NET demo, "Customising Mouseover Marks" (in the "Mousever hints" section of the demo). A script could be used to take a point index and return that to the server.

Regards,
Marc Meumann
Steema Support

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Thu Dec 11, 2008 4:13 pm

Thanks Marc

Post Reply