How to disable or modify the tooltip on a graph

Jul 7, 2013 at 3:56 PM
Hi everybody!!

Please help me!!

You know that when a graph is displayed a fantastic tooltip come in your help to display the coordinates of the mouse selected point.

But I've to display two graphs on the same diagram which are properly scaled so that the max Y value of both the graphs are the same.

It follows that the scaled Y obtained from the tooltip are not representing the originals but the scaled.

So I need to interfere with the mechanism of the tooltip to modify the displayed values or, if it is not possible, to disable the tooltip from one of the graph.

To display the graph I use a PlotModel object to which property PlotModel.Series I next add a LineSeries which represent the graph to display.

Can anyone gime me some feedback?

Thank you very much
Jul 7, 2013 at 5:50 PM
Create properties (X', Y') with INotifyPropertyChanged interface implemented that represents the X and Y transformed coordinates. Then add an event to the desired LineSeries (as shown in the examples MouseEvents):
                yourLineSeries.MouseDown += (s, e) =>
                       {
                           if ((e.ChangedButton != OxyMouseButton.Left))
                           {
                               return;
                           }

                      //Here catch the screenpoint
                      //Transform to coordinates of your LineSeries
                      //Apply the scaling X'=a*X, Y'=b*Y
                           e.Handled = true;
                       }; 
The last step is to bind via XAML that properties to the tracker. See the custom tracker examples.

Good luck
Jul 8, 2013 at 11:00 AM
Thank you very much!!!

I've tried to implement your solution without reaching the goal to obtain a tooltip with a scaled versions of the point coordinates.

I've to give a result as soon as possible.

So I ask you: please is there a fast way to disable the tooltip for a certain LineSeries?

Thank you very much!! :D
Jul 8, 2013 at 2:58 PM
I think you only need to handle the event
yourLineSeries.MouseDown += (s, e) =>
                       {
                           if ((e.ChangedButton != OxyMouseButton.Left))
                           {
                               return;
                           }
                           e.Handled = true;
                       }; 
Jul 8, 2013 at 3:19 PM
It's true!!!! Thank you very much raphay :D