Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Customizing Graphs and Charts

Each graph and chart includes many options that you can use to customize appearance, convey more information, or highlight data. Although graphs and charts plot data differently, they have several common options that you access from the shortcut menu. However, some options are available only for a specific type of graph or chart.

Using Multiple X- and Y-Scales

All graphs support multiple x- and y-scales, and all charts support multiple y-scales. Use multiple scales on a graph or chart to display multiple plots that do not share a common x- or y-scale. Right-click the scale of the graph or chart and select Duplicate Scale from the shortcut menu to add multiple scales to the graph or chart.

Autoscaling

All graphs and charts can automatically adjust their horizontal and vertical scales to fit the data you wire to them. This behavior is called autoscaling. Right-click the graph or chart and select X Scale»AutoScale X or Y Scale»AutoScale Y from the shortcut menu to turn autoscaling on or off. By default, autoscaling is enabled for the graph or chart. However, autoscaling can slow performance.

Use the Operating tool or the Labeling tool to change the horizontal or vertical scale directly.

Formatting X- and Y-Scales

Use the Format and Precision page of the Properties dialog box to specify how the scales of the x-axis and y-axis appear on the graph or chart.

By default, the x-scale is configured to use floating-point notation and have a label of Time, and the y-scale is configured to use automatic formatting and have a label of Amplitude. To configure the scales for the graph or chart, right-click the graph or chart and select Properties from the shortcut menu to display the Graph Properties dialog box or Chart Properties dialog box.

Use the Format and Precision page of the Properties dialog box to specify a numeric format for the scales of a graph or chart. Click the Scales tab to rename the scale and to format the appearance of the axis scale. By default, a graph or chart scale displays up to six digits before automatically switching to exponential notation.

On the Format and Precision page, select Advanced editing mode to display the text options that let you enter format strings directly. Enter format strings to customize the appearance and numeric precision of the scales.

Using the Graph Palette

Use the graph palette, shown as follows, to interact with a graph or chart while the VI is running.

With the graph palette, you can move cursors, zoom, and pan the display. Right-click the graph or chart and select Visible Items»Graph Palette from the shortcut menu to display the graph palette. The graph palette appears with the following buttons, in order from left to right:

  • Cursor Movement Tool (graph only)—Moves the cursor on the display.
  • Zoom—Zooms in and out of the display.
  • Panning Tool—Picks up the plot and moves it around on the display.

Click a button in the graph palette to enable moving the cursor, zooming the display, or panning the display. Each button displays a green LED when it is enabled.

Customizing Graph and Chart Appearance

Customize the appearance of a graph or chart by showing or hiding options. Right-click the graph or chart and select Visible Items from the shortcut menu to display or hide the following options:

  • Plot Legend—Defines the color and style of plots. Resize the legend to display multiple plots.
  • Scale Legend—Defines labels for scales and configures scale properties.
  • Graph Palette—Allows you to move the cursor and zoom and pan the graph or chart while a VI runs.
  • X Scale and Y Scale—Formats the x- and y-scales.
  • Cursor Legend (graph only)—Displays a marker at a defined point coordinate. You can display multiple cursors on a graph.
  • X Scrollbar—Scrolls through the data in the graph or chart. Use the scroll bar to view data that the graph or chart does not currently display.
  • Digital Display (waveform chart only)—Displays the numeric value of the chart.

Exporting Images of Graphs, Charts, and Tables

You can include black and white images of graphs, charts, tables, and digital data and digital waveform controls and indicators into presentations, email, text documents, and so on. When you export a simplified image, LabVIEW exports only the control or indicator, digital display, plot legend, and index display and does not export scrollbars, the scale legend, the graph palette, or the cursor palette.

You can export images into the following formats:

Windows .emf, .bmp, and .eps files

Mac .pict, .bmp, and .eps files

Linux .bmp and .eps files

You can save the image to the clipboard or to disk.

Note  The Export Simplified Image option is not available for intensity graphs or intensity charts.

Customizing Graphs

Each graph includes options that you can use to customize the graph to match your data display requirements. For example, you can modify the behavior and appearance of graph cursors or configure graph scales. The following figure shows the elements of a graph.

1 Plot legend

2 Cursor

3 Scale legend

4 Cursor mover

5 Cursor legend

6 Minor-grid mark

7 Grid mark

8 X-scale

9 Graph palette

10 Y-scale

11 Label

You add most of the items listed in the legend above by right-clicking the graph, selecting Visible Items from the shortcut menu, and selecting the appropriate element. Right-click the graph and select the option from the shortcut menu to set the graph option.

Using Graph Cursors

Use a cursor on a graph to read the exact value of a point on a plot or a point in the plot area. The cursor value displays in the cursor legend.

Tip  You can use an annotation instead of a cursor to highlight data points on the plot area.

The following figure shows an example of a graph using multiple cursors.

Right-click the graph and select Visible Items»Cursor Legend from the shortcut menu to view the cursor legend. Add a cursor to the graph by right-clicking anywhere in the cursor legend, selecting Create Cursor, and selecting a cursor mode from the shortcut menu.

The cursor position is defined by the cursor mode. The cursor includes the following modes:

  • Free—Moves the cursor freely within the plot area, regardless of plot positions.
  • Single-Plot—Positions the cursor only on the plot that is associated with the cursor. You can move the cursor along the associated plot. Right-click the cursor legend row and select Snap To from the shortcut menu to associate one or all plots with the cursor.
  • Multi-Plot—Positions the cursor only on a specific data point in the plot area. The multi-plot cursor reports values at the specified x-value for all of the plots with which the cursor is associated. You can position the cursor on any plot in the plot area. Right-click the cursor legend row and select Snap To from the shortcut menu to associate one or all plots with the cursor. This mode is valid only for mixed signal graphs.
Note  You cannot change the mode of a cursor after you create it. You must delete the cursor and create another cursor.

You can customize the appearance of the cursor in several ways. You can label the cursor on the plot, specify the color of the cursor, and specify line, point, and cursor style. Right-click the cursor legend row and select items from the shortcut menu to customize the cursor.

Using Graph Annotations

Use annotations on a graph to highlight data points in the plot area. The annotation includes a label and an arrow that identifies the annotation and data point. A graph can have any number of annotations. The following figure shows an example of a graph using annotations.

Right-click the graph and select Data Operations»Create Annotation from the shortcut menu to display the Create Annotation dialog box. Use the Create Annotation dialog box to specify the annotation name and how the annotation snaps to plots in the plot area.

Use the Lock Style pull-down menu in the Create Annotation dialog box to specify how the annotation snaps to plots in the plot area. The Lock Style component includes the following options:

  • Free—Allows you to move the annotation anywhere in the plot area. LabVIEW does not snap the annotation to any plots in the plot area.
  • Snap to All Plots—Allows you to move the annotation to the nearest data point along any plot in the plot area.
  • Snap to One Plot—Allows you to move the annotation only along the specified plot.

You can customize the behavior and appearance of the annotation in several ways. You can hide or show the annotation name or arrow in the plot area, specify the color of the annotation, and specify line, point, and annotation style. Right-click the annotation and select options from the shortcut menu to customize the annotation.

To delete the annotation, right-click the annotation and select Delete Annotation from the shortcut menu. Right-click the graph and select Data Operations»Delete All Annotations from the shortcut menu to delete all annotations in the plot area.

Customizing 3D Graphs

The 3D graphs have many options that you can use to customize them, including 3D plot styles, scale formatting, grids, and plot projection. Because the 3D graphs use ActiveX technology and VIs that handle 3D representation, you set options for the 3D graphs differently than you set options for other graphs. While creating an application, use the ActiveX Property Browser to set properties for a 3D graph. Right-click the 3D graph and select Property Browser from the shortcut menu to display the ActiveX Property Browser.

If you want to allow users to change common properties at run time or you need to set a property programmatically, use the 3D Graph Properties VIs.

Customizing Charts

Unlike the graph, which displays new data that overwrites any stored data, the chart updates periodically and maintains a history of the data previously stored.

You can customize the chart to match your data display requirements. Options available for all charts include a scroll bar, the scale legend, the graph palette, a digital display, and representation of scales with respect to time. You also can modify the behavior of chart history length, update modes, and plot displays.

Configuring Chart History Length

LabVIEW stores data points already added to the chart in a buffer, or the chart history. The default size for a chart history buffer is 1,024 data points. Right-click the chart and select Chart History Length from the shortcut menu to configure the history buffer. You can view previously collected data using the chart scroll bar. Right-click the chart and select Visible Items»X Scrollbar from the shortcut menu to display a scroll bar.

Note  Large chart history values can be memory intensive.

Configuring Chart Update Modes

You can configure how the chart updates to display new data. Right-click the chart and select Advanced»Update Mode from the shortcut menu to set the chart update mode. The chart uses the following modes to display data:

  • Strip Chart—Shows running data continuously scrolling from left to right across the chart with old data on the left and new data on the right. A strip chart is similar to a paper tape strip chart recorder. Strip Chart is the default update mode.
  • Scope Chart—Shows one item of data, such as a pulse or wave, scrolling partway across the chart from left to right. For each new value, the chart plots the value to the right of the last value. When the plot reaches the right border of the plotting area, LabVIEW erases the plot and begins plotting again from the left border. The retracing display of a scope chart is similar to an oscilloscope.
  • Sweep Chart—Works similarly to a scope chart except it shows the old data on the right and the new data on the left separated by a vertical line. LabVIEW does not erase the plot in a sweep chart when the plot reaches the right border of the plotting area. A sweep chart is similar to an EKG display.

Using Overlaid and Stacked Plots

You can display multiple plots on a chart by using a single vertical scale, called overlaid plots, or by using multiple vertical scales, called stacked plots. The following figure shows examples of overlaid plots and stacked plots.

Right-click the chart and select Stack Plots from the shortcut menu to view the chart plots as multiple vertical scales. Right-click the chart and select Overlay Plots to view the chart plots as a single vertical scale.

Refer to the Charts VI in the labview\examples\general\graphs\charts.llb for examples of different kinds of charts and the data types they accept.

 


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit