To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This simply VI illustrates how we can easily implement code to change the units used on a graph or chart. The code uses property nodes of the chart to update both the minimum and maximum values and the axis title.
Description
A case structure is used to allow us to switch between the different units available. A Type Definition Enum allows us to select what units we want to be displayed. Within each case different scales and axis titles are defined. Additionally a conversion factor is applied to the data which corresponds to the conversion between the different units. The random number generator has been used simply to illustrate the example and has been multiplied by 5 to make the illustration clearer. The example could be expanded to change more features of the graph such as the units marker intervals. In this case the units of the y-axis are updated, but the code could be expanded to update the x-axis.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.