To download NI software, including the products shown below, visit ni.com/downloads.
This example creates a multiplot waveform graph with cursors that follow the movements of the mouse while staying attached to the corresponding plot. The effect created is similar to the graphs on Google Finance.
The Moving Cursor Graph allows users to visually match data points with the actual values of those points and compare those values across multiple plots. An event structure is used to find the coordinates of any mouse movements, and those coordinates are transformed to graph coordinates using a simple proportion. Using property nodes, the cursors are then moved to those new graph coordinates. Another property node is used to find the Y-value of the plot at that X-coordinate, and the value is written to an indicator. A for loop is then used to repeat this process for each plot included on the graph.
The Moving Cursor Graph creates a more interactive front panel: adding form as well as function. The VI could be wrapped into an X-control, which could then be easily implemented into existing front panels.
1. Download the proper version of the VI
2. Run the VI
3. Move the mouse over the graph and watch the cursors follow the movements.
LabVIEW 2010 or newer
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Thanks a lot!
Your VI pointed me to the solution of locking a created cursor to the nearest plot, such that it not always jumps back to plot 0 when dragged!
Simple once I found the property nodes: Active Cursor (ActCsr) and cursor.Cursor Plot
This method has a bit of complexity. I couldn't understand how to calculate "125" and "559".
Getting X position by this way is easier way.