Selecting Specific Series

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.


Top of page

x
Syntax: How to Select Specific Series
series: [
{series: number, property: value, ..., property: value},
]

where:

series: number

Selects a series for the specified properties. Valid values are:

  • A zero-based series number. If the series does not exist in the chart, the property is ignored.
  • 'all', to apply the properties to all series.
  • 'reset', to remove default properties before assigning the specified properties.
property: value

Is a supported series property and its value.



Example: Selecting Specific Series

The following request generates a vertical bar chart with four series and specifies colors for 10 series:

GRAPH FILE WFLITE
SUM COGS_US GROSS_PROFIT_US REVENUE_US DISCOUNT_US
ACROSS PRODUCT_CATEGORY
ON GRAPH HOLD 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 WFLITE
SUM COGS_US MSRP_US
ACROSS PRODUCT_CATEGORY
ON GRAPH HOLD 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 WFLITE
SUM COGS_US 
ACROSS PRODUCT_CATEGORY
ON GRAPH HOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET STYLE *
*GRAPH_JS
    riserCycleEndLightness: 0.4,
series: [{series: 'reset', color: undefined},
{series: 0, color: 'teal'}   
]
*END
ENDSTYLE
END

The output is:


Information Builders