Incorrect Axis Markers When XY Graph Is Updated Programmatically in LabVIEW

Updated Dec 4, 2023

Reported In

Software

  • LabVIEW

Issue Details

When updating the X scale of an XY graph using events, the axis markers in the scale appear to be out of place, affecting the readability of the graph. 

I am using the Mouse Down and Mouse Up events, along with property nodes, to update the graph by clicking on a starting point in the scale and releasing the mouse button in another position within the same axis scale, allowing me to visualize certain parts of the plot in greater detail. It works as intended, but after updating the scale, a value can be seen on top of another or out of place from a tick marker, while one of the tick markers shows no value associated with it. 
 
image.png

If the clicks are made on the plot area and not the scale, this problem is not seen. How can I avoid this behavior?

Solution

The visual bug is triggered when the event code catches the mouse down click on a scale marker and interrupts the text-edit transaction that the scale was starting to carry out. The scale has an internal field that remembers the marker that was clicked on and draws it in its old location.

Currently, to avoid this behavior you can create a property node from the XY graph and set the XScale.Editable property with a False constant, before the program reaches the execution of the event used to change the axis' scale range.
 
image.png

Additional Information

The XScale.Editable property can be used to allow or prohibit a change in the scale when trying to manually modify it during the execution of the VI. However, as the Mouse Down and Mouse Up events will detect the mouse actions, it will trigger the corresponding events, leading to a change in the scale values regardless of the XScale.Editable property. This workaround avoids the visual bug while it still allows the scale to be modified programmatically.