How to: |
A docked legend is a minimized (collapsed) legend that shows only an active expand button and can also show pictograms of the legend.
legend: { dock:{ enabled: enboolean, animate: anboolean, minimized: minboolean, resizeFrame: reboolean, showMarkers: shboolean, expandDirection: 'direction', button: { size: bsize, color: 'buttoncolor', hoverColor: 'hovcolor', border: { width: borwidth, color: 'bordercolor', dash: 'dstyle' } } } }
where:
Controls whether a docked legend will be generated. Valid values are:
Controls whether the expansion and contraction of the legend is animated using a slide action. Valid values are:
Controls whether a docked legend is initially collapsed or expanded. Valid values are:
Controls whether the frame shrinks and expands as the legend is collapsed and expanded. Valid values are:
Controls whether a collapsed docked legend displays the legend markers. Valid values are:
Specifies the direction of expansion ('left', 'right', 'top', 'bottom' for a legend whose position is free. For legends whose positions are not free, the value is undefined, and the chart engine determines the direction of expansion.
Defines the size of the button (defined as two times the distance from the center of the object to the furthest corner of the shape) in pixels, or can be 'auto' to draw the button the same size as the legend markers. The default value is 'auto'.
Is a color specification string that defines the button color. The default value is 'grey'.
Is a color specification string that defines the button color when the mouse hovers over it or clicks it. The default value is 'black'.
Defines the width of the button border in pixels. The default value is zero (0).
Is a color specification string that defines the color of the button border. The default value is 'transparent'.
Is a string that defines the dash style of the border. The default value is '' (a solid line). Use a string of numbers that defines the width of a dash in pixels followed by the width of the gap between dashes in pixels (for example, dash: '1 1' draws a dotted line).
Multiple dashes can be defined within the dash string (for example, '2 4 4 2'), in which case, the dash types will alternate along the border.
The following request generates a legend that is initially collapsed but shows the legend markers. The expand button has a diameter of 25 pixels, is lime green with a blue border, and turns yellow when the mouse hovers over or clicks it:
GRAPH FILE WF_RETAIL_LITE SUM COGS_US GROSS_PROFIT_US MSRP_US REVENUE_US BY PRODUCT_CATEGORY ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET STYLE * *GRAPH_JS xaxis: {majorGrid: {visible:false}}, yaxis: {majorGrid: {visible:false}}, legend: { dock:{ enabled: true, animate: true, minimized: true, resizeFrame: true, showMarkers: true, expandDirection: undefined, button: { size: 25, color: 'limegreen', hoverColor: 'yellow', border: { width: 1, color: 'blue', dash: '' } } } } *END TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=MSRP_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=REVENUE_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $ ENDSTYLE END
The following image shows the initial view, with the legend collapsed:
The following image shows the legend expanded, with the mouse hovering over the button (the hover color is displaying). The chart frame has resized:
WebFOCUS | |
Feedback |