I'm sure this is a simple question, but after several hours of searching, I've been unable to find any examples. I'm using XamDataChart with a simple column series in a fairly simple "drill-down" type of application. When the user double-clicks on one of the category values, I need a way to determine the value of the category so I can use it as a filter for other activities on the window.
I'm converting this form over from one which was previously using the XamChart. In that form we used things like DataChart.HitTest to get a HitTestArgs object and then used the SelectedObject method to get the DataPoint which received the click. There doesn't appear to be anything similar in the XamDataChart.
Any help would be greatly appreciated.
Thanks,
Steve
Hello,
I have been looking into your requirements and I can suggest you check the following forum thread which discuss a similar topic:
http://community.infragistics.com/forums/p/50226/264216.aspx
By handling the MouseDoubleClick you can calculate the unscaledX value and depending on your axis type it will return a double value that indicates the position of the mouse click. For example if you click exactly between the first two points displayed on the XamDataChatr the unscaledX will equals 0.5; if you click between the second and third point it will return nearly 1.5 and so on. Based on this value you can retrieve the index of the data point the user has clicked and check its value from your data source collection.
If you need any further assistance on this, please do not hesitate to ask.
The post you reference is more than a year old and some of the properties referenced in the post have been deprecated in the latest version of XamDataChart.
Is there no easy way to simply get the value of the data point in which the user clicked? If I write an event handler for the MouseDoubleClick event on the series, I would think that the event handler should have access to the data point which was clicked rather than reverting to mouse coordinates.
Hello Steve,
I have been researching this for other possible approaches to achieve this and currently with exposed functionality you can get the clicked series by handling the XamDataChart’s SeriesMouseLeftButtonDown event and use e.Series . Still I will continue investigating the described issue and I am going to contact our developers about this. I will update you as soon as I have more information for you.
Thank you for your patience.
Hello petrinat ,
I believe that currently your best option in order to achieve this is the approach discussed in the following forum thread:
By handling the MouseDoubleClick you can calculate the unscaledX value and depending on your axis type it will return a double value that indicates the position of the mouse click as I already suggested in my previous post- you can achive this by getting the unscaled value and find the coresponding point in your data source collection.
Hi Elena,
I am using XamDataChart and I have category x axis. How do I get the actual x value for the data point in the series mouse down event handler?
Thanks in advance
If you still need any assistance on the matter do not hesitate to ask
Just to be clear, would you please specify the type of axis that you use for your series- category, numeric, olap, ets .