Difference between revisions of "Graph ColorSeq"

 
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[category:System Variables]]
+
[[Category:System Variables]]
 +
[[Category: Graphs]]
  
= SysVar Graph_ColorSeq =
+
== SysVar Graph_ColorSeq ==
  
The system variable defines the sequence of colors used for curves in a graph. If the system is not set, Analytica uses an internal default.  
+
This system variable specifies the sequence of colors used for lines, symbols, or bars in graphs. (If the variable is not set, Analytica uses an internal default color sequence.) Each color is specified by a triplet of numbers, giving the intensity of Red, Green and Blue (RGB), on a scale from 0 (off) to 65535 (maximum).  Thus, the definition of [[Graph_ColorSeq]] is a tuple containing n triplets or 3n numbers.  
  
The system variable must be a tuple containing 3 numbers for each color defined. The total length of the tuple should therefore be a multiple of 3. The numbers in the tuple are the Red, Green and Blue intensities of each color in succession.  Each intensity is defined on a scale from 0 (totally off) to 65535 (totally on).  (Note: Analytica will also accept -1 for fully on, treating negative values as 65535-x).
+
Analytica does not yet offer a graphical interface to modify color sequences. You can only set it via the [[Typescript]] window, or in a function called from a Button script. For example, you could enter the following into the Typescript:
 +
:<code>Graph_ColorSeq: [65535,0,0, 0,65535,0, 0,0,65535, 65535,65535,0, 65535,0,65535, 0,65535,65535, 0,0,0]</code>
  
There is currently no GUI for setting the color sequence, so this must be done manually via typescript.  The color sequence can be defined separately for a graph template, so that the color sequence applies to any variable that uses that template.
+
These colors are red, green, blue, yellow, magenta, aqua, black, respectively.  
  
The following statement would define a color sequence with 7 distinct colors:
+
This example specifies only 7 colors. A graph needing more than 7 colors will repeat after the first 7.
  
Graph_ColorSeq : [ 65535,0,0, 0,65535,0, 0,0,65535, 65535,65535,0, 65535,0,65535, 0,65535,65535, 0,0,0 ]
+
A color intensity can also be a negative value: It interprets -n as 65536-n. Thus, it treats -1 as 65535, i.e. totally on.
  
Here the colors are, in sequence: red, green, blue, yellow, magenta, aqua, black.
+
The colors in system variable, [[Graph_ColorSeq]] are the global default for all graphs.  You can override these colors for a single variable by assigning RGB colors to [[Graph_ColorSeq]] in the [[GraphSetup]] attribute of the variable -- for variable X, for example:
  
To set a global default, set the system variable.  To set a color sequence that applies only to a graph template, add the line to set the system variable to the template's graphSetup attribute.  For example:
+
:<code>(GraphSetup of X := (GraphSetup of X) & chr(13)</code>
 +
::<code>& "Graph_ColorSeq := [65535,0,0, 0,65535,0, 0,0,65535]")</code>
  
  ( Graph_ColorSeq of MyTempl := (Graph_ColorSeq of MyTempl) & chr(13)
+
You can also specify the color sequence for a graph template by adding the assignment in the [[GraphSetup]] attribute of the template, which will control the color sequence for every graph using that template -- for example for template T:
      & "Graph_ColorSeq := [65535,0,0, 0,65535,0, 0,0,65535]" )
 
  
To set a graph color sequence that applies to a single graph, insert the setting in this same fashion in the variable's graphSetup attribute.
+
:<code>(GraphSetup of T := (GraphSetup of T) & chr(13)</code>
 
+
::<code>& "Graph_ColorSeq := [65535,0,0, 0,65535,0, 0,0,65535]")</code>
= See Also =
 
  
 +
== See Also ==
 
* [[Graph_SymbolSeq]]
 
* [[Graph_SymbolSeq]]
 +
* [[Graph settings]]
 +
* [[Graph Setting Associations]]
 +
* [[Typescript]]

Latest revision as of 01:36, 26 April 2021


SysVar Graph_ColorSeq

This system variable specifies the sequence of colors used for lines, symbols, or bars in graphs. (If the variable is not set, Analytica uses an internal default color sequence.) Each color is specified by a triplet of numbers, giving the intensity of Red, Green and Blue (RGB), on a scale from 0 (off) to 65535 (maximum). Thus, the definition of Graph_ColorSeq is a tuple containing n triplets or 3n numbers.

Analytica does not yet offer a graphical interface to modify color sequences. You can only set it via the Typescript window, or in a function called from a Button script. For example, you could enter the following into the Typescript:

Graph_ColorSeq: [65535,0,0, 0,65535,0, 0,0,65535, 65535,65535,0, 65535,0,65535, 0,65535,65535, 0,0,0]

These colors are red, green, blue, yellow, magenta, aqua, black, respectively.

This example specifies only 7 colors. A graph needing more than 7 colors will repeat after the first 7.

A color intensity can also be a negative value: It interprets -n as 65536-n. Thus, it treats -1 as 65535, i.e. totally on.

The colors in system variable, Graph_ColorSeq are the global default for all graphs. You can override these colors for a single variable by assigning RGB colors to Graph_ColorSeq in the GraphSetup attribute of the variable -- for variable X, for example:

(GraphSetup of X := (GraphSetup of X) & chr(13)
& "Graph_ColorSeq := [65535,0,0, 0,65535,0, 0,0,65535]")

You can also specify the color sequence for a graph template by adding the assignment in the GraphSetup attribute of the template, which will control the color sequence for every graph using that template -- for example for template T:

(GraphSetup of T := (GraphSetup of T) & chr(13)
& "Graph_ColorSeq := [65535,0,0, 0,65535,0, 0,0,65535]")

See Also

Comments


You are not allowed to post comments.