答案 0 :(得分:5)
弹出窗口在OxyPlot的源代码中称为Tracker
。
您可以通过OxyPlot.Wpf.PlotView.DefaultTrackerTemplate
在XAML中将其ControlTemplate定义为:
<oxy:PlotView Model="{Binding SomePlotModel}">
<oxy:PlotView.DefaultTrackerTemplate>
<ControlTemplate>
<!-- Put your content here-->
</ControlTemplate>
</oxy:PlotView.DefaultTrackerTemplate>
</oxy:PlotView>
如果每个系列数据需要不同的跟踪器,请使用OxyPlot.Wpf.PlotView.TrackerDefinitions
。例如,如果您的LineSeries具有TrackerKey="LineSeriesXyzTrackerKey"
,则将其跟踪器定义为:
<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>
DataContext
的{{1}}是ControlTemplate
,您可以在此处查看可用的属性:
https://github.com/oxyplot/oxyplot/blob/master/Source/OxyPlot/PlotController/Manipulators/TrackerHitResult.cs
一些例子: How can I show the plot points in Oxyplot for a line Graph? http://discussion.oxyplot.org/topics/592-wpf-tracker-multiple-value/