10-19-2012 10:20 AM
Hi all
I saw that the Snappable property has been added to XYPlot, to set if cursors can snap to the plot or not.
I need the same feature in the wpf Plot (NationalInstrument.Controls.Plot), to make invisible plots not snappable. I have checked the plot properties and the cursor properties but I have only found the SnapToData property of the cursor (which is a boolean) and the AllowablePlots that can be set only to "Single" or "Any" values (is an enum type).
10-19-2012
11:39 AM
- last edited on
11-20-2024
08:33 AM
by
Content Cleaner
Unfortunately, we did not have time to implement all of the cursor behaviors for the first release of the WPF graph controls. Currently, there is no property available on plots or cursors to configure snapping behavior to the level of granularity you want.
As a workaround, you can derive from Cursor
and re-define its value snapping behavior. For example, the class below resets the position of the cursor if the nearest value is not on a visible plot:
public class CustomCursor : NationalInstruments.Controls.Cursor {
protected override void OnDragMoveCore( Point updatedCursorRelativePosition, object context ) {
Point currentPosition = GetRelativePosition();
base.OnDragMoveCore( updatedCursorRelativePosition, context );
if( ActualPlot.Visibility != Visibility.Visible )
SetRelativePosition( currentPosition );
}
}
08-11-2015
10:38 AM
- last edited on
11-20-2024
08:34 AM
by
Content Cleaner
Just wanted to let you know this issue was fixed in the Measurement Studio 2015 release.