SpreadJS Documentation
style Method
GC.Spread.Sheets.Shapes Namespace > Shape type : style Method
The shape style.
Gets or sets the style of the shape.
Syntax
var instance = new GC.Spread.Sheets.Shapes.Shape(worksheet, name, autoShapeTypeOrModel, left, top, width, height);
var returnValue; // Type: any
returnValue = instance.style(value);
function style( 
   value : ShapeStyle
) : any;

Parameters

value
The shape style.
Example
//This sample sets style 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;
oldStyle.line.color = "green";
oldStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot;
oldStyle.line.width = 5;
oldStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square;
oldStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter;
oldStyle.line.transparency = 0.5;
oldStyle.textEffect.color = "yellow";
oldStyle.textEffect.transparency = 0.5;
oldStyle.textEffect.font = "20px Arial";
oldStyle.textFrame.vAlign = GC.Spread.Sheets.VerticalAlign.center;
oldStyle.textFrame.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
heart.style(oldStyle);
heart.text("Heart");
See Also

Reference

Shape type