Example Code

Moving a Graph Cursor Legend Programmatically

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This VI shows a workaround of changing the location of the legend programmatically by creating an array containing the cursor information. 

 

Description

In LabVIEW 8.0 and later there is not a property node to change the position of a graph's cursor legend.  If you wish to programmatically change the location of the legend, create an array containing the cursor information as shown in this workaround.

 

 

Instead of using the graph's cursor legend, set the visibility of the legend to False. Then create a new array of clusters containing the name and position of each cursor.  Use the Position property to change the Front Panel location of the new cursor array.

1.PNG

 

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run cursor_legend_lv80.vi or Move Cursor Legend 2012 NIVerified.vi (attached).
  2.  Change the Left or Top position of the cursor legend.
  3. Drag the cursor on the Waveform Graph and see the X and Y position update in the cursors array.
  4. Use the Stop button to stop the VI.

 

Additional Information or References

 

Front Panel

2.PNG

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Jennifer R.
National Instruments
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
leonidas.mauricio
Member
Member
on

Hello,

I have a problem. I want to change the style and number of arrow in the "Cursor Legend" I just need "left and right" and of course it would be very useful to change that interface. I've already make some arragement that I would like to appear. First I thought that I could change the style of those arrow then my group of research told me that it's necessary to appear a "Slide Control" in order to control the "CURSOR" in the Waveform Graph it also needs to change the value with those arrow but I've tried many times and without results. If you can help me with that, you definetely be the one!PANEL.GIFvi snippets.png