[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
在线咨询 立即试用
(Showing Draft Content)

GC.Spread.Pivot.CustomPivotTableThemeManager

Class: CustomPivotTableThemeManager

Spread.Pivot.CustomPivotTableThemeManager

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

• new CustomPivotTableThemeManager(workbook)

表示一个可以管理所有自定义数据透视表主题的管理器。

Parameters

Name Type Description
workbook Workbook 工作簿对象。

Overrides

CustomThemeManagerBase.constructor

Methods

add

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

Parameters

Name Type Description
theme string | PivotTableTheme 新的数据透视表主题或仅为要添加的新主题名称

Returns

undefined | PivotTableTheme

返回新添加的数据透视表主题,如果同名主题已存在,则添加失败并返回 undefined


all

▸ all(): PivotTableTheme[]

获取数据透视表主题集合。

example

// 获取所有数据透视表主题
let tableStylesCollection = spread.customPivotTableThemes.all();

Returns

PivotTableTheme[]

Array<GC.Spread.Pivot.PivotTableTheme>


get

▸ get(name): undefined | PivotTableTheme

按名称获取数据透视表主题。

example

// 获取数据透视表主题
pivotTableStyle = spread.customPivotTableThemes.get("custom0");

Parameters

Name Type Description
name string 要获取的数据透视表主题的特定名称

Returns

undefined | PivotTableTheme

如果找到具有指定名称的对应主题,则返回该主题;否则返回 undefined


remove

▸ remove(name): void

按名称删除数据透视表主题。

example

// 删除数据透视表主题
spread.customPivotTableThemes.remove("custom0");

Parameters

Name Type Description
name string 要删除的数据透视表主题的特定名称

Returns

void


update

▸ update(oldThemeName, newTheme): void

更新数据透视表主题。

example

// 更新数据透视表主题
tableStyle = spread.customPivotTableThemes.update("custom0", new GC.Spread.Pivot.PivotTableTheme());

Parameters

Name Type Description
oldThemeName string 要更新的数据透视表主题的特定名称
newTheme PivotTableTheme 新的数据透视表主题

Returns

void