Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis limits don't get updated anymore after zooming/panning #748

Open
Trass3r opened this issue Jan 25, 2016 · 4 comments
Open

Axis limits don't get updated anymore after zooming/panning #748

Trass3r opened this issue Jan 25, 2016 · 4 comments

Comments

@Trass3r
Copy link

Trass3r commented Jan 25, 2016

The behavior we see in our real-time plot (basically LineSeries with ItemsSource bound to continuously updated ObservableCollection) is also visible in the Wpf RefreshDemo.
For example in the "Refresh by calling InvalidatePlot on the Plot control" view the view stops following the data as soon as you zoom or pan and there seems to be no way to get it back to the "follow" state.

@objorke
Copy link
Member

objorke commented Jan 26, 2016

I think this is desired behavior - when you pan or zoom a plot, the new "viewport" should override the automatic one.
Can you reset the view every time you update the plot?

@objorke objorke changed the title axes limits don't get updated anymore after zooming/panning Axis limits don't get updated anymore after zooming/panning Jan 26, 2016
@tibel
Copy link
Contributor

tibel commented Jan 27, 2016

Axis.Reset() and then PlotModel.InvalidatePlot(false) should do what you want to reset the axis to default behavior.

@Trass3r
Copy link
Author

Trass3r commented Jan 27, 2016

Ok thanks will need to check how to get there.
Using a setup like this example: https://github.com/oxyplot/oxyplot/blob/develop/Source/Examples/WPF/WpfExamples/Examples/BindingObservableCollectionDemo/MainWindow.xaml

@Trass3r
Copy link
Author

Trass3r commented Jan 27, 2016

<oxy:Plot.ContextMenu>
    <ContextMenu>
        <MenuItem Header="Reset" Click="ContextMenuReset_OnClick" />
    </ContextMenu>
</oxy:Plot.ContextMenu>
private void ContextMenuReset_OnClick(object sender, RoutedEventArgs e)
{
    plot.ResetAllAxes();
    plot.InvalidatePlot(false);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants