LeighHerbert Posted March 2, 2009 Report Share Posted March 2, 2009 Is it possible to catch a click event on a chart item (point, bar, label) on the client side? I know how to handle these on the server, but my application uses callbacks and I want to be able to update other page controls based on chart clicks. Is this possible? Quote Link to comment Share on other sites More sharing options...
AndreG Posted March 2, 2009 Report Share Posted March 2, 2009 If you are rendering your chart as .NET, every event can be captured on clientside. The ZoomScrollbar sample uses a lot of clientside events. http://support.softwarefx.com/FeaturedSamples/ZoomScrollBar.zip If you are rendering as image, you would have to link the point to js functions, which limits what you can do. Quote Link to comment Share on other sites More sharing options...
LeighHerbert Posted March 6, 2009 Author Report Share Posted March 6, 2009 Are there any examples of how to link the points to JS functions? Quote Link to comment Share on other sites More sharing options...
AndreG Posted March 6, 2009 Report Share Posted March 6, 2009 To link every point of the chart to a JS function called myFunction, passing as parameters the Series and Point that were clicked, here is the code you need. Link mylink = Chart1.AllSeries.Link;mylink.Url = "Javascript:myFunction(%S,%N)"; Note that the flags used here are the same used to create custom tooltips. They are all listed on your API, under ToolTipFormat property of the Chart class. Attached is a sample that demonstrates a drilldown using links to JS functions. Quote Link to comment Share on other sites More sharing options...
AndreG Posted March 6, 2009 Report Share Posted March 6, 2009 Hmmmm... The forums do not like it when I spell out JS... Let me use an image instead of text. Attached is what the sample code above (not project) was supposed to be. Quote Link to comment Share on other sites More sharing options...
LeighHerbert Posted March 9, 2009 Author Report Share Posted March 9, 2009 Andre, Thank you very much for your reply, this was exactly what I was after. Quote Link to comment Share on other sites More sharing options...
AndreG Posted March 9, 2009 Report Share Posted March 9, 2009 Great! No problem... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.