How to: |
The backgroundcolor property defines the background color of the legend area.
legend: {
backgroundcolor: color}
where:
Can be:
For information about defining colors and gradients, see Colors and Gradients.
The following request makes the background color of the legend area tan:
GRAPH FILE WFLITE SUM DISCOUNT_US GROSS_PROFIT_US REVENUE_US MSRP_US BY PRODUCT_CATEGORY ON GRAPH HOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH VBAR ON GRAPH SET STYLE * INCLUDE=ENDEFLT,$ *GRAPH_JS legend: { backgroundcolor: 'tan' } , series: [ {series: 0, color: 'lightgreen'}, {series: 1, color: 'coral'}, {series: 2, color: 'lightblue'}, {series: 3, color: 'burlywood'} ] *END ENDSTYLE END
The output is:
The following request applies a linear gradient that transitions from bisque to ghostwhite to the legend background area:
GRAPH FILE WFLITE SUM DISCOUNT_US GROSS_PROFIT_US REVENUE_US MSRP_US BY PRODUCT_CATEGORY ON GRAPH HOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH VBAR ON GRAPH SET STYLE * INCLUDE=ENDEFLT,$ *GRAPH_JS legend: { position: 'right', backgroundcolor: { type: 'linear', start: {x: '0%', y: '0%'}, end: {x: '100%', y: '100%'}, stops: [ [0, 'bisque'],[1, 'ghostwhite'], ], lineStyle: { width: 2, color: 'navy', }, }, }, series: [ {series: 0, color: 'lightgreen'}, {series: 1, color: 'coral'}, {series: 2, color: 'lightblue'}, {series: 3, color: 'burlywood'} ] *END ENDSTYLE END
The output is:
Information Builders |