Wpf oxyplot - change popup when datapoint is clicked

I am using oxyplot with wpf and I want to change the popup if I click datapoint. OxyplotDataPointClick

Is it possible to change? I saw several examples that show how to get a click, but nothing to change the style.

thank

+4
source share
1 answer

The popup is called Trackerin the source code of OxyPlot. You can define its ControlTemplate in XAML through OxyPlot.Wpf.PlotView.DefaultTrackerTemplateas:

<oxy:PlotView Model="{Binding SomePlotModel}">
  <oxy:PlotView.DefaultTrackerTemplate>
    <ControlTemplate>
       <!-- Put your content here-->
    </ControlTemplate>
   </oxy:PlotView.DefaultTrackerTemplate>
</oxy:PlotView>

If a different tracker is needed for each data series, use OxyPlot.Wpf.PlotView.TrackerDefinitions. For example, if you have LineSeries with TrackerKey="LineSeriesXyzTrackerKey", then its tracker determines as:

<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 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/

+5

Source: https://habr.com/ru/post/1629923/


All Articles