Controlling the Visibility of Individual Series

How to:

The visible property controls the visibility of individual series.

Syntax: How to Control the Visibility of Individual Series

"series":
[
    (
      "series": number,
      "visible": boolean,
   }
]

where:

"series": number

Is a zero-based series number. If the series does not exist in the chart, the property is ignored.

"visible": boolean

Controls the visibility of the specified series. Valid values are:

  • true, which makes the series visible. This is the default value.
  • false, which makes the series not visible.

Example: Controlling the Visibility of Individual Series

The following request generates a vertical bar chart and makes series 0 not visible:

GRAPH FILE WF_RETAIL_LITE
SUM DISCOUNT_US GROSS_PROFIT_US REVENUE_US MSRP_US
BY PRODUCT_CATEGORY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_JS
"title": {"visible": true, "text": "{series: 0, visible: false}", 
	"font": "14pt Verdana", "color": "brown"},
"border": {"width": 2, "color": "teal"},
"series": [
	{"series": 0, "color": "rgb(204,255,255)", "label": "SERIES ZERO", "visible": false},
	{"series": 1, "color": "tan", "label": "SERIES ONE"},
	{"series": 2, "color": "lightblue", "label": "SERIES TWO"},
	{"series": 3, "color": "rgb(226,185,229)", "label": "SERIES THREE"}]
*END
ENDSTYLE
END

On the output, series 0 has no risers and no entry in the legend:

WebFOCUS

Feedback