Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WPF Graph: part of the line disappears

Solved!
Go to solution

Hi,

I have encountered a visualization problem with WPF graph: when I try to draw one specific signal, some segments of the line might disappear as I resize the graph (see attached video).

 

The signal should look like this:

The_Bn_2-1600082863728.png

Disappearing segments of line:

The_Bn_3-1600083028284.png

These two segments blink intermittently as I resize, and they don't appear or disappear if I do nothing. Also they seem to appear/disappear independently of each other.

 

The special about signal is that it has triangle profile at the segments which blink:

The_Bn_4-1600083640414.pngThe_Bn_5-1600083670292.pngThe_Bn_6-1600083698137.pngThe_Bn_7-1600083719003.png

The segments that are actual horizontal lines are displayed normally and don't blink.

 

I didn't manage to reproduce this issue on the test app.

Maybe someone has any idea how to prevent this behavior?

 

0 Kudos
Message 1 of 4
(1,649 Views)

That definitely looks like a rendering issue in the graph. Although you could not reproduce the problem in a test app, it would still be helpful to know how the graph is configured (e.g. render mode, machine DPI settings), how the plot renderer is configured (e.g. stroke thickness), and the range of data values (e.g. sample rate, overall axis range, and the high/low values on the triangular segment).

 

You might also try setting the stroke thickness to 1, as single-pixel lines use a different rendering path that may avoid the problem area.

~ Paul H
0 Kudos
Message 2 of 4
(1,599 Views)

Hi, sorry for late responce, but I finally reproduced the issue on test app by setting all ranges as we have on production app and displaying the exact data from there. It is attached.

 

The_Bn_0-1600684579015.png

I reproduced disappearing, but didn't reproduce blinking: on my test app missing parts of signal are always missing. They are not missing completely, there is thin line where they should be, however on production app it's the same.

 

Render mode is "Hardware", machine DPI is default 100%. I'm currently running the app on remote desktop, if it matters. Setting stroke thickness to 1 doesn't help.

0 Kudos
Message 3 of 4
(1,539 Views)
Solution
Accepted by topic author The_Bn

Thank you for the reproduction! I have created a work item to fix this issue.

 

Also attached is a workaround plot renderer to address the rendering artifacts; you can use it by wrapping your existing plot renderer:

 

<ni:Plot Name="Plot1">
    <local:SimplifySubPixelPlotRenderer>
        <ni:LinePlotRenderer Stroke="Red" StrokeThickness="2" />
    </local:SimplifySubPixelPlotRenderer>
</ni:Plot>

 

 

~ Paul H
0 Kudos
Message 4 of 4
(1,509 Views)