[]
Spread.Pivot.CustomPivotTableThemeManager
↳ CustomPivotTableThemeManager
• new CustomPivotTableThemeManager(workbook)
表示一个可以管理所有自定义数据透视表主题的管理器。
| Name | Type | Description |
|---|---|---|
workbook |
Workbook |
工作簿对象。 |
CustomThemeManagerBase.constructor
▸ add(theme): undefined | PivotTableTheme
添加一个新的数据透视表主题。
example
// 添加一个名为 "custom0" 的新数据透视表主题
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let pivotTableStyle = spread.customPivotTableThemes.add("custom0");
let wholeTableStyle = new GC.Spread.Pivot.PivotTableStyle();
wholeTableStyle.backColor = "#0C66E4";
pivotTableStyle.wholeTableStyle(wholeTableStyle);
| Name | Type | Description |
|---|---|---|
theme |
string | PivotTableTheme |
新的数据透视表主题或仅为要添加的新主题名称 |
undefined | PivotTableTheme
返回新添加的数据透视表主题,如果同名主题已存在,则添加失败并返回 undefined
▸ all(): PivotTableTheme[]
获取数据透视表主题集合。
example
// 获取所有数据透视表主题
let tableStylesCollection = spread.customPivotTableThemes.all();
Array<GC.Spread.Pivot.PivotTableTheme>
▸ get(name): undefined | PivotTableTheme
按名称获取数据透视表主题。
example
// 获取数据透视表主题
pivotTableStyle = spread.customPivotTableThemes.get("custom0");
| Name | Type | Description |
|---|---|---|
name |
string |
要获取的数据透视表主题的特定名称 |
undefined | PivotTableTheme
如果找到具有指定名称的对应主题,则返回该主题;否则返回 undefined
▸ remove(name): void
按名称删除数据透视表主题。
example
// 删除数据透视表主题
spread.customPivotTableThemes.remove("custom0");
| Name | Type | Description |
|---|---|---|
name |
string |
要删除的数据透视表主题的特定名称 |
void
▸ update(oldThemeName, newTheme): void
更新数据透视表主题。
example
// 更新数据透视表主题
tableStyle = spread.customPivotTableThemes.update("custom0", new GC.Spread.Pivot.PivotTableTheme());
| Name | Type | Description |
|---|---|---|
oldThemeName |
string |
要更新的数据透视表主题的特定名称 |
newTheme |
PivotTableTheme |
新的数据透视表主题 |
void