[]
        
(Showing Draft Content)

GC.Spread.Pivot.PivotTableTimelineSlicer

类: PivotTableTimelineSlicer

Spread.Pivot.PivotTableTimelineSlicer

Table of contents

构造方法

方法

构造方法

constructor

new PivotTableTimelineSlicer()

透视表时间线切片器

方法

allowMove

allowMove(value?): any

获取或设置切片器的allowMove

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.allowMove();
console.log(oldValue);
slicer.allowMove(false);
var newValue = slicer.allowMove();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的allowMove;否则,返回切片器


allowResize

allowResize(value?): any

获取或设置切片器的allowResize

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.allowResize();
console.log(oldValue);
slicer.allowResize(false);
var newValue = slicer.allowResize();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的allowResize;否则,返回切片器


captionName

captionName(value?): any

获取或设置切片器的captionName

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.captionName();
console.log(oldValue);
slicer.captionName('timeline_caption');
var newValue = slicer.captionName();
console.log(newValue);

参数

属性名 类型
value? string

返回值

any

如果没有设置值,返回切片器的captionName;否则,返回切片器


connectPivotTable

connectPivotTable(ptName): void

用切器关联的透视表

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);

timeline.connectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
timeline.disconnectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');

参数

属性名 类型 说明
ptName string 透视表的名称

返回值

void


disableResizingAndMoving

disableResizingAndMoving(value?): any

获取或设置切片器的 disableResizingAndMoving

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.disableResizingAndMoving();
console.log(oldValue);
slicer.disableResizingAndMoving(false);
var newValue = slicer.disableResizingAndMoving();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的disableResizingAndMoving;否则,返回切片器


disconnectPivotTable

disconnectPivotTable(ptName): void

获取或设置切片器的disconnectPivotTable

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);

timeline.connectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
timeline.disconnectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');

参数

属性名 类型 说明
ptName string 透视表的名称

返回值

void


dynamicMove

dynamicMove(value?): any

获取或设置切片器的dynamicMove

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.dynamicMove();
console.log(oldValue);
slicer.dynamicMove(false);
var newValue = slicer.dynamicMove();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的dynamicMove;否则,返回切片器


dynamicSize

dynamicSize(value?): any

获取或设置切片器的dynamicSize

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.dynamicSize();
console.log(oldValue);
slicer.dynamicSize(false);
var newValue = slicer.dynamicSize();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的dynamicSize;否则,返回切片器


endColumn

endColumn(value?): any

获取或设置切片器的endColumn

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.endColumn();
console.log(oldValue);
slicer.endColumn(9);
var newValue = slicer.endColumn();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的endColumn;否则,返回切片器


endColumnOffset

endColumnOffset(value?): any

获取或设置切片器的endColumnOffset

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.endColumnOffset();
console.log(oldValue);
slicer.endColumnOffset(10);
var newValue = slicer.endColumnOffset();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的endColumnOffset;否则,返回切片器


endRow

endRow(value?): any

获取或设置切片器的endRow

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.endRow();
console.log(oldValue);
slicer.endRow(7);
var newValue = slicer.endRow();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的endRow;否则,返回切片器


endRowOffset

endRowOffset(value?): any

获取或设置切片器的endRowOffset

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.endRowOffset();
console.log(oldValue);
slicer.endRowOffset(5);
var newValue = slicer.endRowOffset();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的endRowOffset;否则,返回切片器


getAllConnectedPivotTables

getAllConnectedPivotTables(): PivotTable[]

获得所有关联的透视表

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);

timeline.connectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
console.log(timeline.getAllPivotTables());
timeline.disconnectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
console.log(timeline.getAllPivotTables());

返回值

PivotTable[]

与切片器相连的透视表


getAllPivotTables

getAllPivotTables(): PivotTable[]

获取所有透视表,无论是否关联

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);

timeline.connectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
console.log(timeline.getAllPivotTables());
timeline.disconnectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
console.log(timeline.getAllPivotTables());

返回值

PivotTable[]

与切片器相同数据源的透视表


getConnectedPivotTableNameList

getConnectedPivotTableNameList(): string[]

获得所有关联的透视表名称

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);

timeline.connectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
console.log(timeline.getAllPivotTables());
timeline.disconnectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
console.log(timeline.getAllPivotTables());

返回值

string[]

name 与切片器连接的数据透视表列表


getStyleName

getStyleName(): undefined | string

获取或设置数据透视表时间线切片器的样式名称。

返回值

undefined | string

返回数据透视表时间线切片器样式名称。


height

height(value?): any

获取或设置切片器的高度

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.height();
console.log(oldValue);
slicer.height(120);
var newValue = slicer.height();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的高度;否则,返回切片器


isConnectedPivotTable

isConnectedPivotTable(ptName): boolean

检查透视表是否与切片器关联

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);

timeline.connectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');
timeline.disconnectPivotTable('pivotTable1');
timeline.isConnectedPivotTable('pivotTable1');

参数

属性名 类型 说明
ptName string 透视表的名称

返回值

boolean

数据透视表是否与时间线切片器连接


isLocked

isLocked(value?): any

获取或设置切片器的isLocked

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.isLocked();
console.log(oldValue);
slicer.isLocked(false);
var newValue = slicer.isLocked();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的isLocked;否则,返回切片器


isSelected

isSelected(value?): any

获取或设置切片器的isSelected

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.isSelected();
console.log(oldValue);
slicer.isSelected(false);
var newValue = slicer.isSelected();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的isSelected;否则,返回切片器


isVisible

isVisible(value?): any

获取或设置切片器的isVisible

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.isVisible();
console.log(oldValue);
slicer.isVisible(false);
var newValue = slicer.isVisible();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的isVisible;否则,返回切片器


level

level(value?): any

获取或设置切片器的level

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.level();
console.log(oldValue);
slicer.level(GC.Spread.Sheets.Slicers.TimelineLevel.years);
var newValue = slicer.level();
console.log(newValue);

参数

属性名 类型
value? TimelineLevel

返回值

any

如果未设置值,则返回切片器的level;否则,返回切片器


name

name(value?): any

获取或设置切片器的name

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.name();
console.log(oldValue);
slicer.name('timeline2');
var newValue = slicer.name();
console.log(newValue);

参数

属性名 类型
value? string

返回值

any

如果没有设置值,返回切片器的名称;否则,返回切片器


nameInFormula

nameInFormula(): string

切片器的nameInFormula

返回值

string

返回nameInFormula


position

position(value?): any

获取或设置切片器的position

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.position();
console.log(oldValue);
slicer.position(new GC.Spread.Sheets.Point(10, 20));
var newValue = slicer.position();
console.log(newValue);

参数

属性名 类型
value? Point

返回值

any

如果没有设置值,返回切片器的position;否则,返回切片器


refresh

refresh(): void

刷新切片器

返回值

void


scrollPosition

scrollPosition(value?): any

获取或设置切片器的scrollPosition

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.showHeader();
console.log(oldValue);
slicer.showHeader(new Date('1973/7/3'));
var newValue = slicer.showHeader();
console.log(newValue);

参数

属性名 类型
value? Date

返回值

any

如果未设置值,则返回切片器的scrollPosition;否则,返回切片器


sheet

sheet(): Worksheet

获取表单

返回值

Worksheet

返回表单


showHeader

showHeader(value?): any

获取或设置切片器的showHeader

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.showHeader();
console.log(oldValue);
slicer.showHeader(false);
var newValue = slicer.showHeader();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果没有设置值,返回切片器的showHeader;否则,返回切片器


showHorizontalScrollbar

showHorizontalScrollbar(value?): any

获取或设置切片器的showHorizontalScrollbar

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.showHorizontalScrollbar();
console.log(oldValue);
slicer.showHorizontalScrollbar(false);
var newValue = slicer.showHorizontalScrollbar();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果未设置值,则返回切片器的showHorizontalScrollbar;否则,返回切片器


showSelectionLabel

showSelectionLabel(value?): any

获取或设置切片器的showSelectionLabel

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.showSelectionLabel();
console.log(oldValue);
slicer.showSelectionLabel(false);
var newValue = slicer.showSelectionLabel();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果未设置值,则返回切片器的showSelectionLabel;否则,返回切片器


showTimeLevel

showTimeLevel(value?): any

获取或设置切片器的showTimeLevel

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.showTimeLevel();
console.log(oldValue);
slicer.showTimeLevel(false);
var newValue = slicer.showTimeLevel();
console.log(newValue);

参数

属性名 类型
value? boolean

返回值

any

如果未设置值,则返回切片器的showTimeLevel;否则,返回切片器


sourceName

sourceName(): string

获取sourceName

返回值

string

返回sourceName


startColumn

startColumn(value?): any

获取或设置切片器的startColumn

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.startColumn();
console.log(oldValue);
slicer.startColumn(5);
var newValue = slicer.startColumn();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的startColumn;否则,返回切片器


startColumnOffset

startColumnOffset(value?): any

获取或设置切片器的startColumnOffset

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.startColumnOffset();
console.log(oldValue);
slicer.startColumnOffset(15);
var newValue = slicer.startColumnOffset();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的startColumnOffset;否则,返回切片器


startRow

startRow(value?): any

获取或设置切片器的startRow

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.startRow();
console.log(oldValue);
slicer.startRow(3);
var newValue = slicer.startRow();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的startRow;否则,返回切片器


startRowOffset

startRowOffset(value?): any

获取或设置切片器的startRowOffset

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.startRowOffset();
console.log(oldValue);
slicer.startRowOffset(10);
var newValue = slicer.startRowOffset();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的startRowOffset;否则,返回切片器


style

style(value?): any

获取或设置切片器的style

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" },
    { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" },
    { Name: "Alice", City: "Washington", Birthday: "2012/2/15" },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);

var style = new GC.Spread.Sheets.Slicers.TimelineStyle()
style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri'));
style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green', '14pt Calibri'));
style.timeLevelStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('yellow'));

var oldValue = slicer.style();
console.log(oldValue);
timeline.style(style);
var newValue = slicer.style();
console.log(newValue);

参数

属性名 类型
value? TimelineStyle

返回值

any

如果没有设置值,返回切片器的style;否则,返回切片器


width

width(value?): any

获取或设置切片器的width

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.width();
console.log(oldValue);
slicer.width(150);
var newValue = slicer.width();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的width;否则,返回切片器


x

x(value?): any

获取或设置切片器的x

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.x();
console.log(oldValue);
slicer.x(30);
var newValue = slicer.x();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的x;否则,返回切片器


y

y(value?): any

获取或设置切片器的y

代码示例

var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") },
    { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") },
    { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1);
var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline);
var oldValue = slicer.y();
console.log(oldValue);
slicer.y(50);
var newValue = slicer.y();
console.log(newValue);

参数

属性名 类型
value? number

返回值

any

如果没有设置值,返回切片器的y;否则,返回切片器