How to configure the Click Event

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

Redzar wrote at 2013-08-21 19:56:

Hello people,
I'm using OxyPlot in a Windows 8 Metro App. When you click, for example in an area chart or a line chart, it appears a label with the values of the chart. The point is, can I change the event when I click by simply passing the mouse over?

Thank you. ^^

everytimer wrote at 2013-08-21 21:00:

That is not supported by the library right now.

Redzar wrote at 2013-08-22 10:04:

There is no way to modify de code and make it? :_(
What is the name of the label?

objo wrote at 2013-08-22 10:30:

It should be possible to set the DefaultTrackerTemplate property to null.
I will submit a fix that hopefully corrects this, will be available at nuget/download later today.
The same behaviour should be implemented on WPF/SL.

Redzar wrote at 2013-08-22 10:52:

Thank you very much!!
Please could you explain how to do it then? ^^

objo wrote at 2013-08-22 20:42:

I checked that this also work on WPF/SL.
Try to set DefaultTrackerTemplate={x:Null} on your Plot control.

Redzar wrote at 2013-08-23 10:10:

Hi Objo,
I downloaded the update and I set the Plot control like this:
<oxy:Plot Model="{Binding PlotModel}" DefaultTrackerTemplate="{x:Null}" Margin="10" BorderBrush="Transparent" Background="{x:Null}" />
But it doesn't work. The label doesn't appear clicking or moving the mouse.
Any idea?

Thanks ^^

everytimer wrote at 2013-08-23 12:26:

I think that disables the Tracker...

Redzar wrote at 2013-08-26 09:47:

So what do I do? My boss will kill me XD

objo wrote at 2013-08-26 11:14:

Redzar: not sure about what you are asking for, I guess I misunderstood - yes, setting the tracker template to null disables the tracker.

See also https://oxyplot.codeplex.com/discussions/454236 if you need to subscribe to the 'tracker changed' event

Redzar wrote at 2013-08-26 11:20:

I just want that when you pass the mouse over the chart, the Tracker is displayed automatically, without having to click.

objo wrote at 2013-08-26 11:46:

This is a feature request - see issue 9963
https://oxyplot.codeplex.com/workitem/9963

Issue 9802 is similar
https://oxyplot.codeplex.com/workitem/9802

Redzar wrote at 2013-08-26 11:50:

o_O
Sorry, I don't understand that post.

objo wrote at 2013-08-26 13:21:

Sorry, I don't think it is possible to show the tracker on mouse-over in the current version.

Redzar wrote at 2013-08-26 13:24:

Oki,
Objo, you know where could be the part of the code that would make it possible to try to do it myself? ^^