Controlling the Visibility of Individual Series

How to:

The visible property controls the visibility of individual series.


Top of page

x
Syntax: How to Control the Visibility of Individual Series
series:
[
    (
      series: snumber,
      visible: boolean,
   }
]

where:

snumber

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

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 against the GGSALES data source generates a vertical bar chart and makes series 0 not visible:

GRAPH FILE GGSALES
SUM  DOLLARS BUDDOLLARS DOLLARS BUDDOLLARS
BY 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