question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WPF Plot Stops Refreshing Until Mouse Panning Stops

See original GitHub issue

Bug Report

Issue: After a brief time of continuous mouse panning (a second or so) the plot stops refreshing until the mouse stops moving.

Reproducing: Click and drag pan constantly (do not let the mouse stop), at first everything refreshes and works but then it stops refreshing and as long as the mouse is kept moving it never redraws, once the mouse stops (even with mouse button not released) it refreshes but has the problem again if panning starts again. The bug is consistently reproducible with a debugger attached to essentially an empty example (see code, axes stop refreshing), or when using the exact same example code in a larger application (without debugger attached). I am not sure why it doesn’t happen in all cases. I have investigated and tried toggling/changing all of the configuration quality options (under WpfPlot.Configuration.Quality and WpfPlot.Configuration.QualityConfiguration) but nothing seems to fix the issue.

This issue is also always reproducible when running the WPF ScottPlot Demo or sandbox/WpfApp in the repository with debugger attached (but does not have the problem when running without debugger). This issue does not seem to be reproducible in WinForms with debugger attached.

I don’t mind the problem being present with a debugger attached, but I have the problem without a debugger attached when using ScottPlot.WPF in a larger application.

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        WpfPlot.Plot.Clear();
        WpfPlot.Refresh();
    }
}
<Window x:Class="GeometryScene.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid x:Name="MainGrid">
        <WpfPlot x:Name="WpfPlot"></WpfPlot>
    </Grid>
</Window>

System Details

  • ScottPlot Version: 4.1.26
  • Operating System: Windows 10
  • Application Type: WPF
  • .NET Version: NET Framework 4.7.1 or NET Framework 4.8.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
riquichcommented, Oct 21, 2021

I am currently busy to switch from nuget to source code, but whenever possible(might be in couple of hours) I will try and post the result here

0reactions
swhardencommented, Oct 22, 2021

@riquich this issue was closed because I just merged #1388 but I wanted to follow-up on this…

@riquich: After the update visuals in my visual layers are misplaced to wrong locations. Like 25% off or so (I’m using 125% DPI), and the ScottPlot image seems abit blurry, and the axis label texts become bigger. So deliberating on the effects of the merge abit more might be a safe option

@riquich: The changes seems to be stemming from the differences between current nuget release and latest source code (#1364)

Hi @riquich, thanks for calling this out! I’m surprised to learn you’re experiencing unexpected behavior because I intended #1364 to have no change in default behavior. That PR has been merged to the main branch and I was planning to push it to NuGet tonight, but your comment makes me want to double-check what may be going on here.

The latest source code in the main branch has a DPI scaling demo at the bottom of the demo application (WPF demo, not the WinForms demo). Is the default behavior still surprising to you, and/or can you meet your program’s goals by setting the DpiStretch configuration option?

WpfPlot1.Configuration.DpiStretch = true; // scaled but blurry
WpfPlot1.Configuration.DpiStretch = false; // 1:1 pixel resolution but small

If your answer is advanced it may be worth discussing further on #1364 instead of here 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

WpfPlot has slower framerate during mouse interactions in ...
First is that the plots seems to stutter when panning in circular/cross ... WPF Plot Stops Refreshing Until Mouse Panning Stops #1387.
Read more >
C# WPF Bindings not updating until MouseOut
When I click on a label, nothing happens until I move the cursor out of the clicked label, then the wanted behaviour executes....
Read more >
ScottPlot 4.1 Cookbook
ScottPlot is designed to display 2D data on linear X and Y axes, but you can log-transform data before plotting it and customize...
Read more >
Mouse Clicks | Customizing User Interaction | yFiles for HTML ...
a mouse click is performed at a location where no clickable item can be found. Note that this may be on another item...
Read more >
ContextMenu does not work on graph when panning is ...
Hi Scichart,. I am struggling with a ContextMenu on a SciChartSurface that wont be displayed. The problem started when i added mouse panning...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found