# Charting Alternatives in PxPlus

Colors |

The colors used to display individual datasets within a chart can be controlled in several ways. They can be:

- Specified in the chart definition Presets.
- Programmed using the 'CurrentSet and TextColour$ properties.
- Defined for various Theme and Visual Class settings.
- Defined in a template file.
- Specified in the %NOMAD_Chart_Colors$ global variable. (NOMADS Only)

These methods are described below.

Method | Description
Presets | Colors of individual datasets can be defined in the chart definition Presets by setting the Data Set number and setting the Property to TextColour. #### Note: This is the only Preset property supported by the Google chart interface.
Program | Programmatically set the dataset colors by setting the 'CurrentSet property to the Data Set number and setting the 'TextColour$ property to the desired color.
Themes and Visual Classes | Use the Chart Colors property in the Themes Maintenance and Visual Classes Maintenance utilities to select the colors to apply when plotting the different datasets of a chart. Click the dotted Query button or double click inside the cell to display the Chart Colors window, which provides a grid for assigning the colors:
|  | Run-Time Chart Example
This window consists of the following:
(Drag and Drop) | Four-headed arrow button used to drag and drop an individual row to a different location within the Chart Colors grid to change the order of the rows entered.
Set # | Dataset sequence (i.e. first dataset, second dataset, etc.).
Color | Click the Query button (magnifying glass) to bring up the Colour Selections window for assigning a color to a dataset. After a color is selected, the color name/expression is displayed. #### Note: After a color is selected, a new row is added to the bottom of the grid for adding another color, if desired.
(Actual Color) | Displays the actual color after a Coloris selected.
Insert Above Insert Below | Adds a blank row above or below the currently selected row to allow a new color to be entered out of sequence. #### Note: A new row cannot be inserted above or below a blank row.
Delete Row(s) | Removes the currently selected row(s). To select multiple rows, use Shift-Click (consecutive selections) or Ctrl-Click (random selections). Prior to deleting, a message will display.
Clear | Removes all the rows in the Chart Colors grid without needing to select them first. Prior to deleting, a message will display.
OK | Saves the chart color selections and closes the Chart Colors window. #### Note: Once chart color selections have been made, the Theme record must be saved/updated. If any unsaved changes are detected, a message will display.
Cancel | Closes the Chart Colors window without saving changes.
(The Chart Colors property in Themes Maintenance and Visual Classes Maintenance was added in PxPlus 2020.)
Template File | The template file is a text file consisting of a list of colors (one per line). The file name must be chart_clrs.txt and be located in a sub-directory of *plus/inomads/templates. For example, the default colors used for the Google charts are defined in *plus/inomads/templates/default/chart_clrs.txt. To create an alternative color selection, create a chart_clrs.txt file and place it in a sub-directory of the templates directory. Example: *plus/inomads/templates/mytemplate/chart_clrs.txt Then, set the global variable %iNomads_Template$ with the name of the sub-directory (in this case %iNomads_Template$="mytemplate"). #### Note: This method is valid for both iNomads and NOMADS environments.
NOMADS Global Variable | (NOMADS Only) Create a string consisting of color names (the last character in the string will be used as the separator) and assign it to the global variable %NOMAD_Chart_Colors$. Example: %Nomad_Chart_Colors$="light red/light blue/dark green/yellow/RGB:192 255 192/"

Colors can be specified using standard PxPlus colors (e.g. Light Red, Dark Blue, etc.), User-Defined colors (e.g. COLOR16), and RGB settings (e.g. RGB:192 255 192). Expressions may also be used in Theme and Visual Class settings for charts. If there are more datasets than colors specified, the colors will repeat.

Color precedence is:

> 1. Programmed colors

> 2. Preset colors

> 3. Visual Class settings

> 4. Theme settings

> 5. Colors specified in the %NOMAD_Chart_Colors$ variable

> 6. Template colors