SpreadJS Documentation
GC.Spread.Sheets Namespace / CellRange type / labelOptions Method
The cell label options.
The cell label position.
The cell label visibility.
The cell label font.
The cell label forecolor.
The cell label margin.
In This Topic
    labelOptions Method
    In This Topic
    Gets or sets the cell label options.
    Syntax
    var instance = new GC.Spread.Sheets.CellRange(sheet, row, col, rowCount, colCount, sheetArea);
    var returnValue; // Type: any
    returnValue = instance.labelOptions(value,
                                        value.alignment,
                                        value.visibility,
                                        value.font,
                                        value.foreColor,
                                        value.margin);
    function labelOptions( 
       value : Object,
       (optional) value.alignment : LabelAlignment,
       (optional) value.visibility : LabelVisibility,
       (optional) value.font : string,
       (optional) value.foreColor : string,
       (optional) value.margin : string
    ) : any;

    Parameters

    value
    The cell label options.
    value.alignment
    The cell label position.
    value.visibility
    The cell label visibility.
    value.font
    The cell label font.
    value.foreColor
    The cell label forecolor.
    value.margin
    The cell label margin.

    Return Value

    If no value is set, returns the value of the cell label options; otherwise, returns the cell.
    Example
    This example sets label options for the watermark.
    var type = new GC.Spread.Sheets.Style();
    type.watermark = "User name";
    type.cellPadding = "20";
    type.labelOptions = {alignment:GC.Spread.Sheets.LabelAlignment.topLeft, visibility: GC.Spread.Sheets.LabelVisibility.visible};
    activeSheet.setStyle(0, 1, type);
    activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60);
    activeSheet.getRange(-1, 1, -1, 1).width(150);
    
    var combo = new GC.Spread.Sheets.CellTypes.ComboBox();
    combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]);
    combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text);
    activeSheet.setCellType(2, 1, combo, GC.Spread.Sheets.SheetArea.viewport);
    activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).watermark("ComboBox Cell Type").cellPadding('10 10 20 10');
    activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).labelOptions({alignment: GC.Spread.Sheets.LabelAlignment.bottomCenter, foreColor: 'yellowgreen', font: 'bold 15px Arial'});
    activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60);
    See Also

    Reference

    CellRange type