I am working on a WPF app that requires charting. I am using OxyPlot. My chart is rendering properly using the following XAML.
<oxy:Plot Height="800" HorizontalContentAlignment="Stretch">
<oxy:Plot.Series>
<oxy:LineSeries ItemsSource="{Binding Series1Points}" MarkerType="Diamond" Title="Series 1" />
<oxy:LineSeries ItemsSource="{Binding Series2Points}" MarkerType="Diamond" Title="Series 2" />
</oxy:Plot.Series>
</oxy:Plot>
I have one challenge that I have been unsuccessful in figuring out. When a series renders, each data point is shown as a diamond. When a user puts their mouse on the diamond, I would like to show a tooltip with the X and Y values of the data point. How can you do that? It seems like it should be possible. Yet, I'm not having any success.
The tooltip is showed just left clicking. To show it when hover you need to modify oxyplot controller:
c#:
public PlotController customController { get; private set; }
...
//Sets the controller to enable show tracker on mouse hover
customController = new PlotController();
customController.UnbindMouseDown(OxyMouseButton.Left);
customController.BindMouseEnter(PlotCommands.HoverSnapTrack);
xaml:
<oxy:Plot Controller="{Binding customController}" Height="800" ... >