Omnis Technical Note TNGI0009

Scatter Graphs Using the $seriesgroupswap Property

For Omnis Studio Version 2.0 or later
By Rudolf Bargholz

The $seriesgroupswap property changes the interpretation of your list data; if false (the default),
list columns are interpreted in your graph as groups, and rows become series, otherwise if true,
list columns are represented as series, and rows as groups; this does not alter the data in your list.
(Reproduced from the Omnis Graphs Documentation).

Translated this means that when you use the following code with the $seriesgroupswap set false:

; By default the graph uses a list format
; to display data. Each line has as it's first
; column a group name in the format:
; (Group,x1,y1,x2,y2,x3,y3, ... )
; after the group name each succeeding pair
; will be used to plot a point on the line

Do List.$define(Header,
Line_1, Col2, Line_3, Col4, Line_5, Col6)
Do List.$add('Group 1',1,2,3,6,5,2)
; the Red Line when $seriesgroupswap is False

Do List.$add('Group 3',2,5,4,5,6,3)
; the Yellow Line when $seriesgroupswap is False

Do List.$add('Group 5',3,5,5,3,8,4)
; the Green Line when $seriesgroupswap is False

You get the following graph:

The following graph will be produced when $seriesgroupswap is set True

And still using the same code

Do List.$define(Header,
    Line_1, Col2, Line_3, Col4, Line_5, Col6)
Do List.$add('Group 1',1,2,3,6,5,2)
; the Red Line when $seriesgroupswap is False

Do List.$add('Group 3',2,5,4,5,6,3)
; the Yellow Line when $seriesgroupswap is False

Do List.$add('Group 5',3,5,5,3,8,4)
the Green Line when $seriesgroupswap is Fals
e

This graph requires some explanation. The first List.$add no longer represents a header and a series of points along a line. Now, the header is ignored (regardless, a value must be provided) and the consecutive pairs now represent the start point for separate lines. Subsequent List.$add items consecutive pairs represent the next point(s) along the line(s). Again, the header is ignored but must be provided.

The headers are used when the $seriesgroupswap is set False (see first graph and the use of 'Group x')

When $seriesgroupswap is set True the headings take on the variable names as defined in the List.$add statement (see second graph and the use of 'Line_x')


Conclusion

Changing the $serisgroupswap property changes the method of accessing the List.$add data.

When False (the default) each succeeding pair will represent a point along one line.

When True the points of the line are defined by consecutive pairs taken from succeeding
List.$add
statements.