SpreadJS 13
GC.Spread.Sheets.Shapes Namespace / ShapeStyle type / fill Field
In This Topic
    fill Field
    In This Topic
    Indicates the fill options.
    Syntax
    var instance = new GC.Spread.Sheets.Shapes.ShapeStyle(style);
    var value; // Type: Object
    value = instance.fill;
    var fill : Object;
    Example
    //This sample sets background color and background color transparency for the shape.
    var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160);
    var oldStyle = heart.style();
    oldStyle.fill.color = "red";
    oldStyle.fill.transparency = 0.5;
    heart.style(oldStyle);
    
    //This sample sets background color and background color transparency with formula for the shape.
    var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160);
    sheet.setValue(0, 1, "red");
    sheet.setValue(1, 1, 0.5);
    var oldStyle = heart.style();
    oldStyle.fill.color = "=Sheet1!B1";
    oldStyle.fill.transparency = "=Sheet1!B2";
    heart.style(oldStyle);
    See Also

    Reference

    ShapeStyle type