SpreadJS 13
GC.Spread.Sheets.Shapes Namespace / ShapeCollection type / zIndex Method
{string} The name of the shape
{number} The z-index for the shape. The zIndex should be between 0 to all shapes length(not contains). A shape with greater zIndex is always in front of a shape with a lower zIndex.
In This Topic
    zIndex Method
    In This Topic
    Get or set the z-index for a shape
    Syntax
    var instance = new GC.Spread.Sheets.Shapes.ShapeCollection(sheet);
    var value; // Type: any
    value = instance.zIndex(shapeName, zIndex);
    function zIndex( 
       shapeName : any,
       zIndex : any
    ) : any;

    Parameters

    shapeName
    {string} The name of the shape
    zIndex
    {number} The z-index for the shape. The zIndex should be between 0 to all shapes length(not contains). A shape with greater zIndex is always in front of a shape with a lower zIndex.
    Example
    //This is a sample shows how to use zIndex.
    var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150);
    var style = shape1.style();
    style.fill.color = "red";
    shape1.style(style);
    var shape2 = activeSheet.shapes.addConnector("shape2", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 100, 50, 200, 200);
    activeSheet.shapes.zIndex("shape2"); // 1
    activeSheet.shapes.zIndex("shape2", 0);
    See Also