Hello,
I'm using a XamDataChart with some ScatterLineSeries and would like to allow the user to click on a marker on the serie to do some action based on the data value of that point.
My question is, how can get the data on the point by clicking on the marker ?
Thank you for the help.
Hello Oussema,
Thank you for your post. I have been looking into the question that you are having and you can use The XamDataChart’s SeriesMouseLeftButtonDown event. In the event arguments of this event, there is an Item property, which returns the clicked item, if you click on a point in the series. I have created a sample application for you, that shows how you can get the clicked point, using this approach.
Please let me know if I can assist you with anything else.
Sincerely,
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Thank you Krasimir for the response.
That should sove part of the problem. Actually, I implemented a template for the serie marker so that I can change the marker color when I click on it (I believe it's not possible with the approach you provided).
My approch is good, and it's working, only I can use it with XAML code. The thing is, I'm building my XamDataChart dynamically, so I need to assign the template I created by the C# code instead.
Do you have any idea on how I can do that.
I've been trying to do it this way:
MarkerEditor me = new MarkerEditor(); //MarkerEditor is my Template for the markersme.TargetPropertyName = "ValNum"; //The YMemberPath in my ScatterLineSeriesme.Width = 20; me.Height = 60;me.Style = (Style)this.Resources[0]; //a style declared in the <UserControl.Resources> of the XAML file
then I do something like : MySerie.MarkerTemplate = new DataTemplate(me.GetType());
Thanks again for the help.