[]
Sheets.Slicers.CustomTimelineThemeManager
↳ CustomTimelineThemeManager
• new CustomTimelineThemeManager(workbook)
表示一个可以管理所有自定义时间轴切片器主题的自定义时间轴切片器主题管理器。
| Name | Type | Description |
|---|---|---|
workbook |
Workbook |
工作簿。 |
CustomThemeManagerBase.constructor
▸ add(theme): undefined | TimelineStyle
添加新的时间轴主题。
example
// 添加一个名为"custom0"的新时间轴主题
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let timeLineStyle = spread.customTimelineThemes.add("custom0");
let wholeTimelineStyle = new GC.Spread.Sheets.Slicers.TimelineStyleInfo();
wholeTimelineStyle.backColor = "#0C66E4";
timeLineStyle.wholeTimelineStyle(wholeTimelineStyle);
| Name | Type | Description |
|---|---|---|
theme |
string | TimelineStyle |
要添加的新时间轴主题或仅是新时间轴主题名称。 |
undefined | TimelineStyle
返回新添加的时间轴主题,如果已存在同名时间轴主题,则添加失败并返回undefined
▸ all(): TimelineStyle[]
获取时间轴主题集合。
example
// 获取所有时间轴主题
let timeLineStylesCollection = spread.customTimelineThemes.all();
Array<GC.Spread.Sheets.Slicers.TimelineStyle>
▸ get(name): undefined | TimelineStyle
通过名称获取时间轴主题。
example
// 获取时间轴主题
timeLineStyle = spread.customTimelineThemes.get("custom0");
| Name | Type | Description |
|---|---|---|
name |
string |
要获取的时间轴主题的特定名称 |
undefined | TimelineStyle
如果找到指定名称的时间轴主题,则返回该主题;否则返回undefined
▸ remove(name): void
通过名称删除时间轴主题。
example
// 删除时间轴主题
spread.customTimelineThemes.remove("custom0");
| Name | Type | Description |
|---|---|---|
name |
string |
要删除的时间轴主题的特定名称 |
void
▸ update(oldThemeName, newTheme): void
更新时间轴切片器主题。
example
// 更新时间轴切片器主题
timelineStyle = spread.customTimelineThemes.update("custom0", new GC.Spread.Sheets.Slicers.TimelineStyle());
| Name | Type | Description |
|---|---|---|
oldThemeName |
string |
要更新的时间轴切片器主题的特定名称 |
newTheme |
TimelineStyle |
要更新的时间轴切片器主题 |
void