Archeg
Archeg

Reputation: 8462

Oxyplot: disable tracker

I have several series, and I need to disable tracker for some of them only. How do I do that?

 <oxy:Plot.Series>
      <oxy:AreaSeries ItemsSource="{Binding PowerValues}" Smooth="False" StrokeThickness="1" Foreground="#6B303030" Color="White"  Color2="#00000000"
                                    Fill="{StaticResource FillColor}" BrokenLineColor="Red"></oxy:AreaSeries>
                    <oxy:StairStepSeries ItemsSource="{Binding PowerTemplateMax}" Smooth="False" StrokeThickness="2" Color="Green" IsManipulationEnabled="False">
                    </oxy:StairStepSeries>
                    <oxy:StairStepSeries ItemsSource="{Binding PowerTemplateMin}" Smooth="False" StrokeThickness="2" Color="Yellow"></oxy:StairStepSeries>
                </oxy:Plot.Series>

AreaSeries should have the trakcer, when both StairStepSeries should not.

Upvotes: 1

Views: 1711

Answers (2)

Mario Musa
Mario Musa

Reputation: 1

model.MouseDown += (s, e) => e.Handled = true;

Upvotes: 0

Anu Viswan
Anu Viswan

Reputation: 18153

One way to achieve this using a Custom Tracker, which is invisible. For example, You could define your tracker as.

    <oxy:PlotView.TrackerDefinitions>
        <oxy:TrackerDefinition TrackerKey="InvisibleTracker">
            <oxy:TrackerDefinition.TrackerTemplate>
                <ControlTemplate>
                    <TextBlock Text="{Binding}" Visibility="Collapsed"/>
                </ControlTemplate>
            </oxy:TrackerDefinition.TrackerTemplate>
        </oxy:TrackerDefinition>
    </oxy:PlotView.TrackerDefinitions>

Notice you have set the visibility of TextBlock as Collapsed. You can now set the TrackerKey for the series for which you need to hide the Tracker to "InvisibleTracker". This would ensure tracker is not visible for those series.

Upvotes: 2

Related Questions