Charting Alternatives in PxPlus

Colors

 

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

These methods are described below.

Method

Description

Presets

Colours 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.

(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