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:
Disappearing segments of line:
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 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?
Solved! Go to Solution.
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.
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.
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.
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>