Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all articles
Browse latest Browse all 2061

New Post: Tracker Format for Custom data points

$
0
0
Look some more on this after my vacation and solved my problem after finding the CustomTrackerDemo..

In my XAML I added:
<oxy:PlotView ... >
                <oxy:PlotView.DefaultTrackerTemplate>
                    <ControlTemplate>
                        <oxy:TrackerControl Position="{Binding Position}" LineExtents="{Binding LineExtents}">
                            <oxy:TrackerControl.Content>
                                <TextBlock Text="{Binding}" Margin="8"/>
                            </oxy:TrackerControl.Content>
                        </oxy:TrackerControl>
                    </ControlTemplate>
                </oxy:PlotView.DefaultTrackerTemplate>
</oxy:PlotView>
In my viewmodel I have a ScatterSeries
 var scatterSeries = new ScatterSeries
      {
        ...
        TrackerFormatString = "{ToolTip}"
      };
      
which I add a custom data point to
 public class ScatterPointWithToolTip : ScatterPoint
  {
    public string ToolTip { get; private set; }

    public ScatterPointWithToolTip(double x, double y, ...., object tooltip) 
      : base(x, y...)
    {
      ToolTip = (string) tooltip;
    }
  }

Viewing all articles
Browse latest Browse all 2061

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>