SpreadJS 14
GC.Spread.Sheets.Charts Namespace / Chart type / legend Method
The legend of the chart.
The position of the chart legend.
The visibility of the chart legend.
The backgroundColor of the chart legend.
The pattern fill backgroundColor type of the chart legend.
The pattern fill foreground color of the chart legend.
The pattern fill background color of the chart legend.
The transparency of the chart legend color
The borderStyle of the chart legend.
The border color of the chart legend.
The border width of the chart legend.
The transparency of the chart legend border color
The color of the chart legend text.
The font family of the chart legend text.
The font size of the chart legend text.
whether the legend display without overlapping chart area
The layout of the chart legend.
The x position of the chart legend, it's percentage, and the base line is chart's left edge.
The y position of the chart legend, it's percentage, and the base line is chart's top edge.
The width of the chart legend, it's percentage, and it's based on the chart's width.
The height of the chart legend, it's percentage, and it's based on the chart's height.
In This Topic
    legend Method
    In This Topic
    Gets or sets the legend of the chart.
    Syntax
    var instance = new GC.Spread.Sheets.Charts.Chart(sheet, name, chartType, x, y, width, height, dataRange, dataOrientation);
    var returnValue; // Type: any
    returnValue = instance.legend(value,
                                  value.position,
                                  value.visible,
                                  value.backColor,
                                  value.backColor.type,
                                  value.backColor.foregroundColor,
                                  value.backColor.backgroundColor,
                                  value.backColorTransparency,
                                  value.borderStyle,
                                  value.borderStyle.color,
                                  value.borderStyle.width,
                                  value.borderStyle.transparency,
                                  value.color,
                                  value.fontFamily,
                                  value.fontSize,
                                  value.showLegendWithoutOverlapping,
                                  value.layout,
                                  value.layout.x,
                                  value.layout.y,
                                  value.layout.width,
                                  value.layout.height);
    function legend( 
       value : Object,
       value.position : LegendPosition,
       value.visible : boolean,
       value.backColor : undefined,
       value.backColor.type : PatternType,
       value.backColor.foregroundColor : string,
       value.backColor.backgroundColor : string,
       value.backColorTransparency : number,
       value.borderStyle : Object,
       value.borderStyle.color : string,
       value.borderStyle.width : number,
       value.borderStyle.transparency : number,
       value.color : string,
       value.fontFamily : string,
       value.fontSize : number,
       value.showLegendWithoutOverlapping : boolean,
       value.layout : Object,
       value.layout.x : number,
       value.layout.y : number,
       value.layout.width : number,
       value.layout.height : number
    ) : any;

    Parameters

    value
    The legend of the chart.
    value.position
    The position of the chart legend.
    value.visible
    The visibility of the chart legend.
    value.backColor
    The backgroundColor of the chart legend.
    value.backColor.type
    The pattern fill backgroundColor type of the chart legend.
    value.backColor.foregroundColor
    The pattern fill foreground color of the chart legend.
    value.backColor.backgroundColor
    The pattern fill background color of the chart legend.
    value.backColorTransparency
    The transparency of the chart legend color
    value.borderStyle
    The borderStyle of the chart legend.
    value.borderStyle.color
    The border color of the chart legend.
    value.borderStyle.width
    The border width of the chart legend.
    value.borderStyle.transparency
    The transparency of the chart legend border color
    value.color
    The color of the chart legend text.
    value.fontFamily
    The font family of the chart legend text.
    value.fontSize
    The font size of the chart legend text.
    value.showLegendWithoutOverlapping
    whether the legend display without overlapping chart area
    value.layout
    The layout of the chart legend.
    value.layout.x
    The x position of the chart legend, it's percentage, and the base line is chart's left edge.
    value.layout.y
    The y position of the chart legend, it's percentage, and the base line is chart's top edge.
    value.layout.width
    The width of the chart legend, it's percentage, and it's based on the chart's width.
    value.layout.height
    The height of the chart legend, it's percentage, and it's based on the chart's height.

    Return Value

    If no value is set, returns the legend of the chart; otherwise, returns the chart.
    Remarks

    The following table lists all the other parameters that can be used while getting or setting the legend of the chart.

    Parameter Type Description
    value.position - The position of the chart legend.
    value.visible boolean The visibility of the chart legend.

    See Also

    Reference

    Chart type