//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");