我正在使用带有wpf的oxyplot,我想在点击数据点时更改弹出窗口. 
有可能改变吗?我看了几个例子,展示了如何获得点击的点,但没有关于改变样式.
谢谢
弹出窗口Tracker在OxyPlot的源代码中调用.您可以通过以下方式在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>
Run Code Online (Sandbox Code Playgroud)
如果每个系列数据需要不同的跟踪器,那么使用 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>
Run Code Online (Sandbox Code Playgroud)
在DataContext为ControlTemplate是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/
| 归档时间: |
|
| 查看次数: |
2099 次 |
| 最近记录: |