# GC.Spread.Sheets.Slicers.CustomTimelineThemeManager

## Content

# Class: CustomTimelineThemeManager

[Sheets](../modules/GC.Spread.Sheets).[Slicers](../modules/GC.Spread.Sheets.Slicers).CustomTimelineThemeManager

## Hierarchy

- [`CustomThemeManagerBase`](GC.Spread.Sheets.CustomThemeManagerBase)

  ↳ **`CustomTimelineThemeManager`**

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.Slicers.CustomTimelineThemeManager#constructor)

### Methods

- [add](GC.Spread.Sheets.Slicers.CustomTimelineThemeManager#add)
- [all](GC.Spread.Sheets.Slicers.CustomTimelineThemeManager#all)
- [get](GC.Spread.Sheets.Slicers.CustomTimelineThemeManager#get)
- [remove](GC.Spread.Sheets.Slicers.CustomTimelineThemeManager#remove)
- [update](GC.Spread.Sheets.Slicers.CustomTimelineThemeManager#update)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new CustomTimelineThemeManager**(`workbook`)

Represents a custom timeline slicer theme manager that can manage all custom timeline slicer themes.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `workbook` | [`Workbook`](GC.Spread.Sheets.Workbook) | The workbook. |

#### Overrides

[CustomThemeManagerBase](GC.Spread.Sheets.CustomThemeManagerBase).[constructor](GC.Spread.Sheets.CustomThemeManagerBase#constructor)

## Methods

### <a id="add" name="add"></a> add

▸ **add**(`theme`): `undefined` \| [`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle)

add a new timeLine theme.

**`example`**
```
// add a new timeLine theme named "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);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `theme` | `string` \| [`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle) | the new timeLine theme or just a new timeLine theme name you want to add. |

#### Returns

`undefined` \| [`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle)

return the newly added timeLine theme, if the named timeLine theme is existed, failed to add timeLine theme and return undefined

___

### <a id="all" name="all"></a> all

▸ **all**(): [`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle)[]

get the timeLine themes collection.

**`example`**
```
// get all timeLine timeLine themes
let timeLineStylesCollection = spread.customTimelineThemes.all();
```

#### Returns

[`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle)[]

Array<GC.Spread.Sheets.Slicers.TimelineStyle>

___

### <a id="get" name="get"></a> get

▸ **get**(`name`): `undefined` \| [`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle)

get the timeLine theme by name.

**`example`**
```
// get timeLine theme
timeLineStyle = spread.customTimelineThemes.get("custom0");
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | the specific name of the timeLine theme to get |

#### Returns

`undefined` \| [`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle)

If the corresponding timeLine theme with the spefic name is found, return the theme; otherwise, return undefined.

___

### <a id="remove" name="remove"></a> remove

▸ **remove**(`name`): `void`

remove the timeLine theme by name.

**`example`**
```
// delete timeLine theme
spread.customTimelineThemes.remove("custom0");
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | the specific name of the timeLine theme to remove |

#### Returns

`void`

___

### <a id="update" name="update"></a> update

▸ **update**(`oldThemeName`, `newTheme`): `void`

update the timeline slicer theme.

**`example`**
```
// update timeline slicer theme
timelineStyle = spread.customTimelineThemes.update("custom0", new GC.Spread.Sheets.Slicers.TimelineStyle());
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `oldThemeName` | `string` | the specific name of the timeline slicer theme to update |
| `newTheme` | [`TimelineStyle`](GC.Spread.Sheets.Slicers.TimelineStyle) | the specific name of the timeline slicer theme to update |

#### Returns

`void`
