[]
Sheets.Slicers.SlicerCollection
• new SlicerCollection(sheet
)
Represents a slicer manager that managers all slicers in a sheet.
Name | Type | Description |
---|---|---|
sheet |
Worksheet |
The worksheet. |
▸ add(slicerName
, targetName
, itemName
, style
, type?
): any
Adds a slicer to the sheet.
example
//This example uses the add method.
//create a table
var datas = [
["1", "NewYork", "1968/6/8", "80", "180"],
["4", "NewYork", "1972/7/3", "72", "168"],
["4", "NewYork", "1964/3/2", "71", "179"],
["5", "Washington", "1972/8/8","80", "171"],
["6", "Washington", "1986/2/2", "89", "161"],
["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
//change the slicer properties.
slicer.position(new GC.Spread.Sheets.Point(100, 200));
Name | Type | Description |
---|---|---|
slicerName |
string |
The name of the slicer. |
targetName |
string |
The name of the table or pivot table that relates to the slicer. |
itemName |
string |
The name of the table column or pivot table field that relates to the slicer. |
style |
SlicerStyle | TimelineStyle |
The style of the slicer. |
type? |
SlicerType |
- |
any
The slicer that has been added to the sheet.
▸ all(targetName?
, itemName?
): ISlicer
[]
Gets all of the slicers in the sheet with the indicated table name and column name.
Name | Type | Description |
---|---|---|
targetName? |
string |
The name of the target (table or pivot table). |
itemName? |
string |
The name of the item. |
ISlicer
[]
The slicer collection.
▸ clear(): void
Removes all of the slicers from the sheet.
void
▸ get(name
): ISlicer
Gets a slicer in the sheet by the name.
Name | Type | Description |
---|---|---|
name |
string |
The name of the slicer. |
The slicer that has the indicated name.
▸ remove(name
): void
Removes a slicer from the sheet using the indicated slicer name.
Name | Type | Description |
---|---|---|
name |
string |
The name of the slicer. |
void