Example Code

LabVIEW - Create Custom XY Legend

Code and Documents

Attachment

Overview
This example VI shows a way to change which data is viewed and have a legend which updates accordingly.

 


Description
To programmatically control which plots are visible on a GraphChart Control, property nodes such as setting the plot visibility are often used. One new feature in LabVIEW 2012 is a checkbox to toggle which plots to be shown on the graph. Unchecking this box will remove the plot from the graph and 'grey-out' the plot image. So this example can help you to remove items from the legend as you wish. It provide a way to change which data is viewed and have a legend which updates accordingly.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached folder to your computer
  2. Open the VI "XY Programmatic Legend 2012 NIVerified.vi"
  3. Edit plot names, plot color, and visibility of pilots
  4. Run the program

 

Additional Information or References
VI Snippet

 VI Snippet.png

 

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

 


Regards,

Peter D

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