Hi,
We have downloaded the trial versions and are in the process of seeing if they match our requirements, so far so good as they are just what we are looking for.
The question:
Is it possible to cycle through the points in the graph from a button click. The reason i am after this is that i have plotted a graph that has time against altitude and i want to be able to show the position at a point on the graph in a label.
The model has DateTime and Altitude properties that are plotted on the graph and a Position property that i want to be able to show in a label. As you click the button i want the graph to cycle through the plotted positions and then put the Position in the label.
Is this possible?
Thanks
Ross
Hi Ross,
It's possible to cycle through the points but this is not something you would do through the chart. This type of thing is best done by cycling through your data source and tracking which item is currently "selected". Then you could expose this "selected" item from your viewmodel and bind your label to it. You can then update the data point in the chart so that it tells the user where the currently "selected" point is. If you are using markers in your series you can provide your own template and inside the template you can change the color if the point is selected. Or you could use the crosshair that comes with the chart and place it over the data point. Or even use the ValueOverlay feature and position that over the selected point.
http://help.infragistics.com/doc/WPF/2015.2/CLR4.0/?page=DataChart_Customizing_Markers.html
http://help.infragistics.com/doc/WPF/2015.2/CLR4.0/?page=DataChart_Chart_Crosshair.html
http://help.infragistics.com/doc/WPF/2015.2/CLR4.0/?page=DataChart_Series_Value_Overlay.html
Hi Rob,
Thanks for the reply.
I hadn't thought of doing it that way but it makes sense. Is there a way to bind an item from the graph bound collection to become the "selected item". I have added a selected item property to my viewModel and that returns an object that the collection is made up of, updating that i have found quite easy but linking back to the graph again eludes me.
Is there some help you can point me in the direction of to get me started?
Regards
I built a sample to demonstrate what I had in mind. I used two of the approaches I mentioned before, the marker template and the ValueOverlay. Actually, using ValueOverlay basically makes using the crosshair redundant for this scenario.
Take a look at the sample and let me know if you have any questions.
Thanks for your reply, i had actually already made progress by the time you posted this and have been able to use your example to make mine slightly better. In the end i went down the route of using a second xaxis series linked to a second collection as i only wanted to show the marker when that item was selected.
Thanks for your help
Nice! Glad you got it working the way you wanted.