SpreadJS 13
GC.Spread.Sheets.Shapes Namespace / Shape type / setFormula Method
The path which can accept a formula string, it could be one of "x", "y", "width", "height", "rotate", "text", "style.fill.color", "style.fill.transparency", "style.line.color", "style.line.lineStyle", "style.line.width", "style.line.capType", "style.line.joinType", "style.line.transparency", "style.textEffect.color", "style.textEffect.transparency", "style.textEffect.font", "style.textFrame.vAlign", "style.textFrame.hAlign".
The formula string.
In This Topic
    setFormula Method
    In This Topic
    Sets the formula string to the shape by the path.
    Syntax
    var instance = new GC.Spread.Sheets.Shapes.Shape(worksheet, name, autoShapeTypeOrModel, left, top, width, height);
    var value; // Type: any
    value = instance.setFormula(path, formula);
    function setFormula( 
       path : string,
       formula : string
    ) : any;

    Parameters

    path
    The path which can accept a formula string, it could be one of "x", "y", "width", "height", "rotate", "text", "style.fill.color", "style.fill.transparency", "style.line.color", "style.line.lineStyle", "style.line.width", "style.line.capType", "style.line.joinType", "style.line.transparency", "style.textEffect.color", "style.textEffect.transparency", "style.textEffect.font", "style.textFrame.vAlign", "style.textFrame.hAlign".
    formula
    The formula string.
    Example
    sheet.name("Sheet1");
    sheet.setValue(0, 1, "This is a rectangle.");
    var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 100, 200, 200);
    shape1.setFormula("text", "=Sheet1!B1");
    See Also

    Reference

    Shape type