SpreadJS 13
GC.Spread.Sheets.Shapes Namespace / Shape type / getFormula 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".
In This Topic
    getFormula Method
    In This Topic
    Gets the formula string from the shape by the path.
    Syntax
    var instance = new GC.Spread.Sheets.Shapes.Shape(worksheet, name, autoShapeTypeOrModel, left, top, width, height);
    var value; // Type: string
    value = instance.getFormula(path);
    function getFormula( 
       path : string
    ) : string;

    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".

    Return Value

    Returns the formula string from the shape by the path.
    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");
    shape1.getFormula("text");//returns "=Sheet1!B1"
    See Also

    Reference

    Shape type