ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Tooltips

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)?

0 Kudos
Message 1 of 4
(5,643 Views)

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?

0 Kudos
Message 2 of 4
(5,627 Views)

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.

~ Paul H
0 Kudos
Message 3 of 4
(5,584 Views)

Also, this question may be helpful to you: WPF graph display point value on hover

~ Paul H
0 Kudos
Message 4 of 4
(5,582 Views)