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 against the GGSALES data source makes the background color of the legend area tan:
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: {
backgroundcolor: 'tan'
},
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:
The following request applies a linear gradient that transitions from bisque to ghostwhite to the legend background area:
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: {
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
INCLUDE=ENIADefault_combine.sty,$
ENDSTYLE
END
The output is:
WebFOCUS |