How to: |
A series selection is a zero-based number or a string. If the series does not exist in the chart, the property is ignored.
series: [ {series: svalue, property:value, ..., property:value}, ]
where:
Selects a series for the specified properties. Valid values are:
Is a supported series property and its value.
The following request against the GGSALES data source generates a vertical bar chart with four series and specifies colors for 10 series:
GRAPH FILE GGSALES
SUM DOLLARS UNITS BUDDOLLARS BUDUNITS
BY PRODUCT
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_JS
series: [
{series: 0, color: 'red'},
{series: 1, color: 'green'},
{series: 2, color: 'blue'},
{series: 3, color: 'orange'},
{series: 4, color: 'lightgreen'},
{series: 5, color: 'yellow'},
{series: 6, color: 'slateblue'},
{series: 7, color: 'lavender'},
{series: 8, color: 'limegreen'},
{series: 9, color: 'red'}
]
*END
ENDSTYLE
END
The colors for series that are not in the chart are ignored. The output is:
The following request generates a vertical line chart and sets the markers for all series to the shape 'triangle' and the size 20:
GRAPH FILE GGSALES
SUM DOLLARS UNITS
BY PRODUCT
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET STYLE *
*GRAPH_JS
series: [{series:'all', marker:{shape:'triangle', size:20}},
{series: 0, color: 'red'},
{series: 1, color: 'green'},
]
*END
ENDSTYLE
END
The output is:
The following request sets the riserCycleEndLightness property, which cycles through defined colors and then, if more series exist, uses a lightening or darkening effect for the rest of the series. However, in order to apply this effect, the default colors must be removed, or they will be used instead of the lightening effect:
GRAPH FILE GGSALES
SUM DOLLARS
ACROSS PRODUCT
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET STYLE *
*GRAPH_JS
riserCycleEndLightness: 0.4,
series: [{series: 'reset', color: undefined},
{series: 0, color: 'green'}
]
*END
ENDSTYLE
END
The output is:
WebFOCUS |