---
title: "Aspose::Cells::Charts::TrendlineCollection::Add method"
url: "https://reference.aspose.com/cells/cpp/aspose.cells.charts/trendlinecollection/add/"
product: "Aspose.Cells for C++ API Reference"
description: "Aspose::Cells::Charts::TrendlineCollection::Add method. Adds a Trendline object to this collection with the specified type in C++."
---

## TrendlineCollection::Add(TrendlineType) method


Adds a [Trendline](../../trendline/) object to this collection with the specified type.

```cpp
int32_t Aspose::Cells::Charts::TrendlineCollection::Add(TrendlineType type)
```


| Parameter | Type | Description |
| --- | --- | --- |
| type | TrendlineType | [Trendline](../../trendline/) type. |

## ReturnValue

[Trendline](../../trendline/) object index.

## See Also

* Class [Vector](../../../aspose.cells/vector/)
* Enum [TrendlineType](../../trendlinetype/)
* Class [TrendlineCollection](../)
* Namespace [Aspose::Cells::Charts](../../)
* Library [Aspose.Cells for C++](../../../)
## TrendlineCollection::Add(TrendlineType, const U16String\&) method


Adds a [Trendline](../../trendline/) object to this collection with specified type and name.

```cpp
int32_t Aspose::Cells::Charts::TrendlineCollection::Add(TrendlineType type, const U16String &name)
```


| Parameter | Type | Description |
| --- | --- | --- |
| type | TrendlineType | [Trendline](../../trendline/) type. |
| name | const U16String\& | [Trendline](../../trendline/) name. |

## ReturnValue

[Trendline](../../trendline/) object index.

## See Also

* Class [Vector](../../../aspose.cells/vector/)
* Enum [TrendlineType](../../trendlinetype/)
* Class [U16String](../../../aspose.cells/u16string/)
* Class [TrendlineCollection](../)
* Namespace [Aspose::Cells::Charts](../../)
* Library [Aspose.Cells for C++](../../../)
## TrendlineCollection::Add(TrendlineType, const char16_t*) method


Adds a [Trendline](../../trendline/) object to this collection with specified type and name.

```cpp
int32_t Aspose::Cells::Charts::TrendlineCollection::Add(TrendlineType type, const char16_t *name)
```


| Parameter | Type | Description |
| --- | --- | --- |
| type | TrendlineType | [Trendline](../../trendline/) type. |
| name | const char16_t* | [Trendline](../../trendline/) name. |

## ReturnValue

[Trendline](../../trendline/) object index.

## See Also

* Class [Vector](../../../aspose.cells/vector/)
* Enum [TrendlineType](../../trendlinetype/)
* Class [TrendlineCollection](../)
* Namespace [Aspose::Cells::Charts](../../)
* Library [Aspose.Cells for C++](../../../)
