Swapping Series, Group, and Label Orientation

How to:

The swapDataAndLabels property can be used to swap series and group orientation, and to swap the labels as well. When false (the default), values in a row in a data set are represented as series. It is the same as the swapData property, except it also swaps the series and group labels. When true, values in a column are represented as series.


Top of page

x
Syntax: How to Swap Series and Group Orientation and Their Labels
swapDataAndLabels: boolean

where:

boolean

Can be:

true, which swaps the series, group, and label orientation.

false, which does not swap the series, group, and label orientation. This is the default value.



Example: Swapping Series, Group, and Label Orientation

The following request against the GGSALES data source generates a vertical bar chart:

GRAPH FILE GGSALES
SUM DOLLARS BUDDOLLARS UNITS BUDUNITS
BY PRODUCT
WHERE CATEGORY EQ 'Gifts'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_JS
    swapDataAndLabels:false,   
series: [
    {series: 0, color: 'lightgreen'},
    {series: 1, color: 'coral'},
    {series: 2, color: 'lightblue'},
    {series: 3, color: 'burlywood'} 
]
*END
INCLUDE=ENIADefault_combine.sty,$
ENDSTYLE
END

On the output:

Changing the swapDataAndLabels property to true generates the following chart, in which:

The labels have also been swapped, to represent the new orientation:


WebFOCUS