Controlling the Visibility of the Legend Area

How to:

The visible property controls the visibility of the legend area.

Syntax: How to Control the Visibility of the Legend Area

"legend": {"visible": boolean} 

where:

"visible": boolean

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 *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
*GRAPH_JS
"legend": {"visible": false},
"series": [
	{"series": 0, "color": "lightgreen"},
	{"series": 1, "color": "coral"},
	{"series": 2, "color": "lightblue"},
	{"series": 3, "color": "burlywood"}
	]
*END
ENDSTYLE
END

The output is:

WebFOCUS

Feedback