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: {value} 

where:

value

Can be:

  • true, which makes the legend visible. This is the default value.
  • false, which makes the legend not visible.
  • 'auto', which makes the legend visible if there is more than one series on the chart.


Example: Controlling Legend Visibility

The following request removes the legend from the chart:

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
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