# DataSetCollection

Namespace: **Wisej.Web.Ext.ChartJS**

Assembly: **Wisej.Web.Ext.ChartJS** (3.2.0.0)

Collection of [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) objects. Represents the sets of data to plot.

{% tabs %}
{% tab title="C#" %}

```csharp
public class DataSetCollection : IList, ICollection, IEnumerable, IList<DataSet>, ICollection<DataSet>, IEnumerable<DataSet>
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DataSetCollection
    Inherits IList
    Implements ICollection, IEnumerable, IList(Of DataSet), ICollection(Of DataSet), IEnumerable(Of DataSet)
```

{% endtab %}
{% endtabs %}

## Properties

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Count

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Returns the number of [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) objects in the collection.

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Item(index)

[DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset): Returns or sets the [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) at the specified position.

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Item(label)

[DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset): Returns or sets the [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) identified by the label name.

## Methods

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Add(dataSet)

Adds a new [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) to the collection.

| Parameter   | Type                                                                                              | Description                                                                                                                     |
| ----------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **dataSet** | [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) | The [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) to add to the collection. |

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Add(name)

Creates and adds a new [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) to the collection.

| Parameter | Type                                                                | Description                                                                                                            |
| --------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **name**  | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) | The name of the new [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset). |

**Returns:** [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset).

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Clear()

Removes all data sets.

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Contains(dataSet)

Checks if the specified [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) exists in the collection.

| Parameter   | Type                                                                                              | Description                                                                                                        |
| ----------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **dataSet** | [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) | The [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) to look for. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean).

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)CopyTo(array, arrayIndex)

Copies all data sets to the specified array.

| Parameter      | Type                                                                                                  | Description                           |
| -------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------- |
| **array**      | [DataSet\[\]](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) | The destination array.                |
| **arrayIndex** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                                     | The index at which to begin the copy. |

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)GetEnumerator()

Returns an enumerator that iterates all the [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) objects in the collection.

**Returns:** [IEnumerator\<DataSet>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerator).

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)IndexOf(dataSet)

Returns the index of the specified [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) in the collection.

| Parameter   | Type                                                                                              | Description |
| ----------- | ------------------------------------------------------------------------------------------------- | ----------- |
| **dataSet** | [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) |             |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32).

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Insert(index, dataSet)

Returns the index of the [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) in the collection.

| Parameter   | Type                                                                                              | Description |
| ----------- | ------------------------------------------------------------------------------------------------- | ----------- |
| **index**   | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                                 |             |
| **dataSet** | [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) |             |

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)Remove(dataSet)

Removes the [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) from the collection and updates the chart.

| Parameter   | Type                                                                                              | Description                                                                                                      |
| ----------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **dataSet** | [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) | The [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) to remove. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean).

### ![](https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFp7MR1wemvcC5891_r%2F-MirBc8UH2o1iZfh0jrC%2F-MirBsnmjWIxMsN8l0Ms%2Finstance.png?alt=media\&token=dff77e9a-7d55-4c1e-9ef7-ac9092f4f565)RemoveAt(index)

Removes the [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) at the specified index from the collection and updates the chart.

| Parameter | Type                                                              | Description                                                                                                                   |
| --------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32) | The index of the [DataSet](https://docs.wisej.com/extensions/extensions/chartjs/api/wisej.web.ext.chartjs.dataset) to remove. |
