Controlling the Visibility of the Legend Area

How to:

The visible property controls the visibility of the legend area.


Top of page

x
Syntax: How to Control the Visibility of the Legend Area
legend: {visible: boolean} 

where:

boolean

Can be:

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


Example: Controlling Legend Visibility

The following request against the GGSALES data source removes the legend from the 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
legend: {
    visible: 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

The output is:


WebFOCUS