How to: |
When legend position is set to 'free', the xy property controls the location of the legend, where x:0, y:0 is the upper left corner of the draw area.
legend: { xy: {x:xnumber, y:ynumber} }
where:
Is a number that defines the x/horizontal location of the legend. The default value is 320.
Is a number that defines the y/vertical location of the legend. The default value is 80.
The following request against the GGSALES data source generates a free (floating) legend and move it to x:100 and y:20:
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: 'free',
xy: {x:100, y:20}
},
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 |