Tracker
。您可以通过XAML定义它的ControlTemplate,方法是使用OxyPlot.Wpf.PlotView.DefaultTrackerTemplate
。<oxy:PlotView Model="{Binding SomePlotModel}">
<oxy:PlotView.DefaultTrackerTemplate>
<ControlTemplate>
<!-- Put your content here-->
</ControlTemplate>
</oxy:PlotView.DefaultTrackerTemplate>
</oxy:PlotView>
OxyPlot.Wpf.PlotView.TrackerDefinitions
。例如,如果您有一个具有TrackerKey="LineSeriesXyzTrackerKey"
的LineSeries,则定义其跟踪器为:<oxy:PlotView Model="{Binding SomePlotModel}">
<oxy:PlotView.TrackerDefinitions>
<oxy:TrackerDefinition TrackerKey="LineSeriesXyzTrackerKey">
<oxy:TrackerDefinition.TrackerTemplate>
<ControlTemplate>
<!-- Put your content here-->
</ControlTemplate>
</oxy:TrackerDefinition.TrackerTemplate>
<oxy:TrackerDefinition TrackerKey="SomeOtherTrackerKey">
<oxy:TrackerDefinition.TrackerTemplate>
<ControlTemplate>
<!-- Put your content here-->
</ControlTemplate>
</oxy:TrackerDefinition.TrackerTemplate>
</oxy:TrackerDefinition>
</oxy:PlotView.TrackerDefinitions>
ControlTemplate
的DataContext
是一个TrackerHitResult
,你可以在这里查看可用的属性:
https://github.com/oxyplot/oxyplot/blob/master/Source/OxyPlot/PlotController/Manipulators/TrackerHitResult.cs
一些示例:
如何在Oxyplot中显示线图中的绘图点?
http://discussion.oxyplot.org/topics/592-wpf-tracker-multiple-value/