SpreadJS 13
GC.Spread.Sheets.Shapes Namespace / ShapeStyle type / textFrame Field
In This Topic
    textFrame Field
    In This Topic
    Indicates the text frame options.
    Syntax
    var instance = new GC.Spread.Sheets.Shapes.ShapeStyle(style);
    var value; // Type: Object
    value = instance.textFrame;
    var textFrame : Object;
    Example
    //This sample sets the text horizontal alignment and vertical alignment for the shape.
    var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160);
    var oldStyle = heart.style();
    oldStyle.textFrame.vAlign = GC.Spread.Sheets.VerticalAlign.center;
    oldStyle.textFrame.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
    heart.style(oldStyle);
    heart.text("Heart");
    
    //This sample sets the text horizontal alignment and vertical alignment 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, 1);
    sheet.setValue(1, 1, 1);
    var oldStyle = heart.style();
    oldStyle.textFrame.vAlign = "=Sheet1!B1";
    oldStyle.textFrame.hAlign = "=Sheet1!B2";
    heart.style(oldStyle);
    heart.text("Heart");
    See Also

    Reference

    ShapeStyle type