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:number, y:number} }
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 generates a free (floating) legend and moves it to x:100 and y:20:
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: 'free', xy: {x:100, y:20} }, 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 |