SpreadJS 13
GC.Spread.Sheets.Shapes Namespace / GroupShape 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 in a groupShape.
    Syntax
    var instance = new GC.Spread.Sheets.Shapes.GroupShape(worksheet, name);
    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 in groupShape.
    var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150);
    var shape2 = activeSheet.shapes.add("shape2", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 150, 50, 100, 150);
    var style = shape1.style();
    style.fill.color = "red";
    shape1.style(style);
    var myGroup = activeSheet.shapes.group([shape1, shape2]);
    myGroup.zIndex("shape2"); // 1
    myGroup.zIndex("shape2", 0);
    See Also

    Reference

    GroupShape type