[]
        
(Showing Draft Content)

GC.Spread.Pivot.PivotTableTimelineSlicer

Class: PivotTableTimelineSlicer

Spread.Pivot.PivotTableTimelineSlicer

Table of contents

Constructors

Methods

Constructors

constructor

new PivotTableTimelineSlicer()

Represents a pivot timeline slicer.

Methods

allowMove

allowMove(value?): any

Gets or sets the allowMove of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The allowMove of the slicer. The allowMove property of a timeline slicer specifies whether users are permitted to move the timeline, enabling or disabling the repositioning functionality.

Returns

any

If no value is set, returns the allowMove of the slicer; otherwise, returns the slicer.


allowResize

allowResize(value?): any

Gets or sets the allowResize of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The allowResize of the slicer. The allowResize property of a timeline slicer specifies whether users are permitted to adjust the size of the timeline, enabling or disabling the resizing functionality.

Returns

any

If no value is set, returns the allowResize of the slicer; otherwise, returns the slicer.


captionName

captionName(value?): any

Gets or sets the captionName of the slicer.

example

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);

Parameters

Name Type Description
value? string The captionName of the slicer. captionName property is displayed in the header of the timeline slicer.

Returns

any

If no value is set, returns the captionName of the slicer; otherwise, returns the slicer.


connectPivotTable

connectPivotTable(ptName): void

Connect pivot table with the slicer

example

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');

Parameters

Name Type Description
ptName string name of pivot table

Returns

void


disableResizingAndMoving

disableResizingAndMoving(value?): any

Gets or sets the disableResizingAndMoving of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The disableResizingAndMoving of the slicer. The disableResizingAndMoving property of a timeline slicer specifies whether the user is allowed to resize or move the timeline slicer, restricting any changes to its size or position.

Returns

any

If no value is set, returns the disableResizingAndMoving of the slicer; otherwise, returns the slicer.


disconnectPivotTable

disconnectPivotTable(ptName): void

Disconnect pivot table with the slicer

example

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');

Parameters

Name Type Description
ptName string name of pivot table

Returns

void


dynamicMove

dynamicMove(value?): any

Gets or sets the dynamicMove of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The dynamicMove of the slicer. The dynamicMove property of a timeline slicer specifies whether the timeline slicer is configured to dynamically adjust its position or size based on changes in the associated data or PivotTable layout.

Returns

any

If no value is set, returns the dynamicMove of the slicer; otherwise, returns the slicer.


dynamicSize

dynamicSize(value?): any

Gets or sets the dynamicSize of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The dynamicSize of the slicer. The dynamicSize property of a timeline slicer specifies whether the timeline is configured to dynamically adjust its size based on changes in the associated data or PivotTable layout.

Returns

any

If no value is set, returns the dynamicSize of the slicer; otherwise, returns the slicer.


endColumn

endColumn(value?): any

Gets or sets the endColumn of the slicer.

example

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);

Parameters

Name Type Description
value? number The endColumn of the slicer. The endColumn property of a timeline slicer specifies the ending column index or position within the worksheet where the timeline concludes or is bounded.

Returns

any

If no value is set, returns the endColumn of the slicer; otherwise, returns the slicer.


endColumnOffset

endColumnOffset(value?): any

Gets or sets the endColumnOffset of the slicer.

example

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);

Parameters

Name Type Description
value? number The endColumnOffset of the slicer. The endColumnOffset property of a timeline slicer specifies the horizontal offset or distance from the ending column index where the timeline concludes its placement within the worksheet.

Returns

any

If no value is set, returns the endColumnOffset of the slicer; otherwise, returns the slicer.


endRow

endRow(value?): any

Gets or sets the endRow of the slicer.

example

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);

Parameters

Name Type Description
value? number The endRow of the slicer. The endRow property of a timeline slicer specifies the ending row index or position within the worksheet where the timeline concludes or is bounded.

Returns

any

If no value is set, returns the endRow of the slicer; otherwise, returns the slicer.


endRowOffset

endRowOffset(value?): any

Gets or sets the endRowOffset of the slicer.

example

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);

Parameters

Name Type Description
value? number The endRowOffset of the slicer. The endRowOffset property of a timeline slicer specifies the vertical offset or distance from the ending row index where the timeline concludes its placement within the worksheet.

Returns

any

If no value is set, returns the endRowOffset of the slicer; otherwise, returns the slicer.


getAllConnectedPivotTables

getAllConnectedPivotTables(): PivotTable[]

get all connected PivotTables

example

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());

Returns

PivotTable[]

PivotTables connected with the slicer.


getAllPivotTables

getAllPivotTables(): PivotTable[]

get all PivotTables whether connected or not.

example

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());

Returns

PivotTable[]

PivotTables whose source is same as the slicer.


getConnectedPivotTableNameList

getConnectedPivotTableNameList(): string[]

get all connected PivotTables' name.

example

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());

Returns

string[]

name list of PivotTables connected with the slicer.


getStyleName

getStyleName(): undefined | string

Gets or sets a style name for the pivot table timeline slicer.

Returns

undefined | string

returns the pivot table timeline slicer style name.


height

height(value?): any

Gets or sets the height of the slicer.

example

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);

Parameters

Name Type Description
value? number The height of the slicer. The height property of a timeline slicer specifies the vertical dimension or height of the timeline, determining its size along the y-axis.

Returns

any

If no value is set, returns the height of the slicer; otherwise, returns the slicer.


isConnectedPivotTable

isConnectedPivotTable(ptName): boolean

Check whether pivot table connect with the slicer

example

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');

Parameters

Name Type Description
ptName string name of pivot table

Returns

boolean

whether pivot table is connected with timeline slicer


isLocked

isLocked(value?): any

Gets or sets the isLocked of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The isLocked of the slicer. The isLocked property of a timeline slicer specifies whether the timeline is currently locked or unlocked, indicating whether users can make changes to its settings or selections when Worksheet is protected.

Returns

any

If no value is set, returns the isLocked of the slicer; otherwise, returns the slicer.


isSelected

isSelected(value?): any

Gets or sets the isSelected of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The isSelected of the slicer. The isSelected property of a timeline slicer specifies whether a particular time period within the timeline slicer is currently selected or highlighted.

Returns

any

If no value is set, returns the isSelected of the slicer; otherwise, returns the slicer.


isVisible

isVisible(value?): any

Gets or sets the isVisible of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The isVisible of the slicer. The isVisible property of a timeline slicer specifies whether the timeline slicer is currently visible or hidden within the workbook.

Returns

any

If no value is set, returns the isVisible of the slicer; otherwise, returns the slicer.


level

level(value?): any

Gets or sets the level of the slicer.

example

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);

Parameters

Name Type Description
value? TimelineLevel The level of the slicer. The level property of a timeline slicer specifies the temporal granularity or time unit (e.g., year, quarter, month) at which the timeline is currently operating, determining the level of detail for date-based filtering and selection.

Returns

any

If no value is set, returns the level of the slicer; otherwise, returns the slicer.


name

name(value?): any

Gets or sets the name of the slicer.

example

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);

Parameters

Name Type Description
value? string The name of the slicer. The name property of a timeline slicer specifies the unique identifier or label assigned to the timeline, allowing for identification and reference within the workbook or programmatic interactions.

Returns

any

If no value is set, returns the name of the slicer; otherwise, returns the slicer.


nameInFormula

nameInFormula(): string

Gets the nameInFormula of the slicer.

Returns

string

returns the nameInFormula of the slicer.


position

position(value?): any

Gets or sets the position of the slicer.

example

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);

Parameters

Name Type Description
value? Point The position of the slicer. The position property of a timeline slicer specifies the placement of the timeline within the worksheet.

Returns

any

If no value is set, returns the position of the slicer; otherwise, returns the slicer.


refresh

refresh(): void

Refresh the slicer.

Returns

void


scrollPosition

scrollPosition(value?): any

Gets or sets the scrollPosition of the slicer.

example

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);

Parameters

Name Type Description
value? Date The scrollPosition of the slicer. The scrollPosition property of a timeline slicer specifies the current scroll position or offset within the timeline, indicating the point where the visible time range begins in relation to the overall timeline data.

Returns

any

If no value is set, returns the scrollPosition of the slicer; otherwise, returns the slicer.


sheet

sheet(): Worksheet

Get the worksheet of the slicer.

Returns

Worksheet

returns the worksheet of the slicer.


showHeader

showHeader(value?): any

Gets or sets the showHeader of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The showHeader of the slicer. The showHeader property of a timeline slicer specifies whether the header, which includes the title and filter-related controls, is displayed in the timeline slicer.

Returns

any

If no value is set, returns the showHeader of the slicer; otherwise, returns the slicer.


showHorizontalScrollbar

showHorizontalScrollbar(value?): any

Gets or sets the showHorizontalScrollbar of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The showHorizontalScrollbar of the slicer. The showHorizontalScrollbar property of a timeline slicer specifies whether a horizontal scrollbar is displayed, allowing users to navigate through the content.

Returns

any

If no value is set, returns the showHorizontalScrollbar of the slicer; otherwise, returns the slicer.


showSelectionLabel

showSelectionLabel(value?): any

Gets or sets the showSelectionLabel of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The showSelectionLabel of the slicer. The showSelectionLabel property of a timeline slicer specifies whether a label indicating the selected time range is displayed, providing users with information about the currently chosen period on the timeline.

Returns

any

If no value is set, returns the showSelectionLabel of the slicer; otherwise, returns the slicer.


showTimeLevel

showTimeLevel(value?): any

Gets or sets the showTimeLevel of the slicer.

example

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);

Parameters

Name Type Description
value? boolean The showTimeLevel of the slicer. The showTimeLevel property of a timeline slicer specifies whether different time levels (e.g., years, quarters, months) are displayed as options for users to select and filter data on the timeline.

Returns

any

If no value is set, returns the showTimeLevel of the slicer; otherwise, returns the slicer.


sourceName

sourceName(): string

Get the sourceName of the slicer.

Returns

string

returns the sourceName of the slicer. The sourceName property of a timeline slicer specifies the name of the source data field associated with the timeline.


startColumn

startColumn(value?): any

Gets or sets the startColumn of the slicer.

example

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);

Parameters

Name Type Description
value? number The startColumn of the slicer. The startColumn property of a timeline slicer specifies the starting column index or position within the worksheet where the timeline is anchored.

Returns

any

If no value is set, returns the startColumn of the slicer; otherwise, returns the slicer.


startColumnOffset

startColumnOffset(value?): any

Gets or sets the startColumnOffset of the slicer.

example

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);

Parameters

Name Type Description
value? number The startColumnOffset of the slicer. The startColumnOffset property of a timeline slicer specifies the horizontal offset or distance from the starting column index where the timeline begins its placement within the worksheet.

Returns

any

If no value is set, returns the startColumnOffset of the slicer; otherwise, returns the slicer.


startRow

startRow(value?): any

Gets or sets the startRow of the slicer.

example

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);

Parameters

Name Type Description
value? number The startRow of the slicer. The startRow property of a timeline slicer specifies the starting row index or position within the worksheet where the timeline is anchored.

Returns

any

If no value is set, returns the startRow of the slicer; otherwise, returns the slicer.


startRowOffset

startRowOffset(value?): any

Gets or sets the startRowOffset of the slicer.

example

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);

Parameters

Name Type Description
value? number The startRowOffset of the slicer. The startRowOffset property of a timeline slicer specifies the vertical offset or distance from the starting row index where the timeline begins its placement within the worksheet.

Returns

any

If no value is set, returns the startRowOffset of the slicer; otherwise, returns the slicer.


style

style(value?): PivotTableTimelineSlicer | TimelineStyle

Gets or sets the style of the slicer.

example

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);

Parameters

Name Type Description
value? string | TimelineStyle The style or style name of the slicer. The style property of a timeline slicer specifies the visual appearance and formatting style applied to the timeline, defining its overall look and presentation.

Returns

PivotTableTimelineSlicer | TimelineStyle

If no style is set, returns the style of the slicer; otherwise, returns the slicer.


width

width(value?): any

Gets or sets the width of the slicer.

example

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);

Parameters

Name Type Description
value? number The width of the slicer. The width property of a timeline slicer specifies the horizontal dimension or width of the timeline, determining its size along the x-axis.

Returns

any

If no value is set, returns the width of the slicer; otherwise, returns the slicer.


x

x(value?): any

Gets or sets the x of the slicer.

example

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);

Parameters

Name Type Description
value? number The x of the slicer. The x property of a timeline slicer specifies the horizontal position or coordinate of the upper-left corner of the timeline within the worksheet.

Returns

any

If no value is set, returns the x of the slicer; otherwise, returns the slicer.


y

y(value?): any

Gets or sets the y of the slicer.

example

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);

Parameters

Name Type Description
value? number The y of the slicer. The y property of a timeline slicer specifies the vertical position or coordinate of the upper-left corner of the timeline within the worksheet.

Returns

any

If no value is set, returns the y of the slicer; otherwise, returns the slicer.