SpreadJS 14
GC.Spread.Pivot Namespace / PivotPanel type
In This Topic
    PivotPanel type
    In This Topic
    Represents the pivot panel of pivot table.
    Syntax
    var instance = new GC.Spread.Pivot.PivotPanel(name, pivotTable, host);
    function PivotPanel;
    Example
    //This example creates a pivot panel.
    var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
    var sourceSheet = spread.getSheet(0);
    var sheet = spread.getSheet(1);
    var sourceData = [["Date","Buyer","Type","Amount"],
                      ["01-Jan","Mom","Fuel",74],
                      ["15-Jan","Mom","Food",235],
                      ["17-Jan","Dad","Sports",20],
                      ["21-Jan","Kelly","Books",125]];
    sourceSheet.setArray(0, 0, sourceData );
    sourceSheet.tables.add('sourceData', 0, 0, 5, 4);
    var layout = GC.Spread.Pivot.PivotTableLayoutType.compact;
    var theme = GC.Spread.Pivot.PivotTableThemes.medium2;
    var options = {showRowHeader: true, showColumnHeader: true};
    var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options);
    pivotTable.suspendLayout();
    pivotTable.options.showRowHeader =true;
    pivotTable.options.showColumnHeader =true;
    pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.columnField);
    pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField);
    pivotTable.add("Amount", "Sum of Amount",   GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum);
    var panel = new GC.Spread.Pivot.PivotPanel("myPivotPanel", pivotTable, document.getElementById("panel"));
    pivotTable.resumeLayout();
    Inheritance Hierarchy

    Object
       GC.Spread.Pivot.PivotPanel

    Constructors
     NameDescription
    public ConstructorRepresents the pivot panel of pivot table.  
    Top
    Methods
     NameDescription
    public Method  
    public Method  
    public Method  
    public Methodstatic (Shared in Visual Basic)Gets the PivotPanel instance by the host element.  
    public Method  
    public Method  
    Top
    See Also