10-10-2013 06:30 AM
I am currently using the WPF graph to display point data for a number of different lists of points held in an ObservableCollection<List<Point>>. The number and length of these lists is variable and so it is created dynamically in my view model and is bound to the graph DataSource property.
I also use the code shown here to extend the graph properties to allow for the definition of a PlotsSource. This allows me to define an ObservableCollection<Plot> to define how to display each list of points. I currently use this to change the plot renderer to either line or point as appropriate and to change the colours.
This all works fine, however if i try and define a tooltip in the plot this does not work - nothing is displayed.
I am trying to avoid code behind since I am working in the MVVM style. How can i display a tooltip for each plot (or ideally each point) which displays custom information (not just the x,y details)?
10-11-2013 10:29 AM
I have managed to get something working now with a PointAnnotation, and a small amount of code behind on my view. My new issue is when i zoom on the graph the annotation moves to the wrong place - is there a way to correct this?
10-18-2013 09:47 AM
Could you describe how you are positioning the annotation? I created a simple version using FindNearestValue
, and was able to position a point annotation on the nearest value regardless of zoom level.
10-18-2013 09:52 AM
Also, this question may be helpful to you: WPF graph display point value on hover