2016-02-22 47 views

回答

5

彈出被稱爲OxyPlot的源代碼Tracker。 您可以在XAML通過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> 

DataContextControlTemplateTrackerHitResult,您可以查看哪些屬性都可以在這裏: 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/

+1

今天你是最好的人:-) - 謝謝! – thardes2