Graphs and charts objects are interactive objects common to many pages in ALiX. Their aspects and behaviors are generally similar but can differ depending on context. This page discusses general features of these objects, some of which might be missing from some graphs (or charts).
1. Graph versus Chart
Graphs are comprised of plots with arbitrary number of data points, each point being specified by its abscissa (say, X) and ordinate (say, Y). A graph can also contain plots with different number of points. The [points in a plot need not be separated by a constant distance (whether along the vertical or horizontal axis).
By contrast, Charts are comprised of plots with the same number of points, each point being specified by its order in the plot and its ordinate. The abscissa
of point n in the plot is defined by , where
is the axis offset and is the increment. Charts are used for time traces (Time Trace page) and Monitored Variables (Scripting page).
2. Graph/Chart components
As shown in the figure below, all Graphs/Charts are comprised of a plot area, a plot legend, a scale legend, a graph palette, and for some of them, a cursor legend and a horizontal scrollbar. Those objects can be laid out differently depending on context, and sometime hidden from view only temporarily. To check whether some of these components are available for a specific graph, check the contextual menu (see next section).
Each of these components has a contextual menu, which can be specific to that object (for instance the Cursor Legend), or generic. The Plot Legend is particular in the sense that right-clicking in different locations can result in different contextual menus. More information on those menus is provided in the next section.
Plot Area: the plot area is where plots are displayed. It can be expanded or shrunk using the Graph Palette tools, or by editing the plot scales end points (there can be more than one scale per axis in some Graphs, which is discussed in the Plot Legend context menu sub-section below). Another way to modify this area is to use the autoscale buttons in the Scale Legend or to move a cursor past the visible bounds.
Plot Legend: the plot legend lists the plots represented in the Graph. Plots can be hidden when the selection checkbox in front of their name is unchecked. A scrollbar can be displayed in some Plot Legends when more plots are available than can be shown in the legend. (Note: confusingly, LabVIEW does not remove plot names of former plots in the legend, which may make it look like some plots are available at the end of the list, that are in fact not existing). Most graphs display a floating tool tip showing up next to the mouse cursor when hovering over the plot legend, allowing to read the full name of plots with names longer than the legend size. Plot names can always be edited by clicking into them.
Scale Legend: The scale legend is an array of objects describing each scale and allowing their manipulation. It is possible to edit their names, display style, etc. in ways which should be self-explanatory.
Graph Palette: the graph palette consists of 3 buttons/drop-down lists. The leftmost one toggles the plot area tool from graph cursor handle to plot area manipulation. The rightmost one allows grabbing the plot area and translating its axes. The center drop-down list allows selecting 1 of 6 zoo tools.
Cursor Legend: Cursors can be created and deleted as needed. Beware than some graphs need cursors to provide the desired functionality (e.g. Photon Arrival Time Histogram in the Alternation Period pages). Cursors are not all created equal: some can be free, or linked to a single plot or to multiple plots.
Horizontal Scrollbar: allows moving the plot along the horizontal axis.
3. Contextual menus
Most graph/chart contextual menus are similar, but some provide access to specific functionalities, which will be generally described in the corresponding page of the manual. Here, we only discuss the most common functions.
The general Plot Area's contextual menu will look something like this:
The location from which the menu is invoked matters in some cases, as it will determine which plot the action is supposed to affect.
Histogram is actually not a universal function, but when present, it applies to the selected plot. Details of its action are discussed in the Histogram Analysis window manual page.
Select/Deselect All Plots: deselected plots are hidden.
Set Style of Selected Plots: opens up a dialog window where different elements of style of multiple plots can be defined at once.
Delete Plot/Delete Selected Plots/Clear Graph/Chart: this behaves as expected, preserving the style of the remaining plots.
Save Plot/Save Selected Plots/Save All Plots: opens up a file dialog window. Plots are saved as tab separated columns, with either a single abscissa column for all plots if the X arrays of all plots are identical (a dialog window pops-up to ask the user whether this is the desired choice) or one abscissa column per plot. The first line in the ASCII file contains the name of the scales the plot is associated with, the type of axis, as well as the plot's name (separated by Tab characters) according to the following syntax:
Scale Name:Scale Type:Plot Name|TAB|Scale Name:Scale Type:Plot Name etc.
where Scale Type is either X or Y and |TAB| indicates the tabulation character (ASCII code 9). The semicolons are part of the syntax.
Note that if the plots have different number of points, the respective columns will have different lengths.
Copy Data: copies the Graph's image to the Clipboard, allowing it to be pasted to another document (e.g. the Notebook). Note that if the autoscale option is on in the Scale Legend, the graph will be rescaled before it is copied. In other words, to obtain an image reproducing exactly what you see, first make sure the autoscale options are off.
Export menu: allows exporting the whole graph or a single plot to the clipboard or to Excel, depending of where the menu was invoked,
4. Plot Style
A plot style can be changed in two different manners: (i) a LabVIEW-native manner and a (ii) ALiX-specific manner.
4.1. Native Plot Style Control
The most powerful approach to changing a plot style is by left--clicking on the style icon to the right of the plot's name, exposing a menu offering a multitude of options:
Most of these functions are self-explanatory and can be freely experimented with.
The X Scale and Y Scale specifies which scale a plot is associated with (in case there are several possible choices).
Note that the Export menu is also accessible via this menu.
4.2. ALiX Plot Style Dialog
Most Graphs/Charts offer an alternative approach offering the possibility to set the style of multiple selected plots at once. This is useful, for instance, to rapidly distinguish some plots from others in a graph. It also allows applying consistent styles from graph to graph.
To access this dialog, right-click on the graph or chart and select Set Style of Selected Plots. The following window opens:
Any unchanged style option will remain untouched in the selected plots, while the others options will be modified. The Preview graph shows the effect of the selected changes on a test plot.
A particularly useful feature of this dialog is the Color List option for Line Color and Point Color. This allows setting the color of the selected plots according to a predefined list of colors. A list can be chosen from the drop-down list shown on the right of the option, or a new one created, edited or deleted by right-clicking on this drop-down list:
Choosing a new list opens up another dialog box allowing to define a finite array of colors:
The list needs to be named, the new name being added to the list of already defined color lists. These lists are saved when ALiX is closed and reloaded when it is restarted, which allows consistent styling from session to session.