Skip to content

SeriesCollection<TKey>

ClassChartGuruChartGuru
public class SeriesCollection<TKey>

A collection of data series with change notification support. Automatically assigns series indices and manages dirty state.

public void Add(DataSeries<TKey> series)

Add a new series to the collection.

Parameters

Name Type
series ChartGuru.DataSeries{{TKey}}
public DataSeries<TKey> Add(TKey key)

Create and add a new series with the given key.

Parameters

Name Type
key {TKey}

Returns

ChartGuru.DataSeries{{TKey}}

public DataSeries<TKey> Add(TKey key, IEnumerable<DataPoint> points)

Create and add a new series with data.

Parameters

Name Type
key {TKey}
points System.Collections.Generic.IEnumerable{ChartGuru.DataPoint}

Returns

ChartGuru.DataSeries{{TKey}}

public DataSeries<TKey> Add(TKey key, IEnumerable<DataPoint> points, Color color)

Create and add a new series with data and color.

Parameters

Name Type
key {TKey}
points System.Collections.Generic.IEnumerable{ChartGuru.DataPoint}
color UnityEngine.Color

Returns

ChartGuru.DataSeries{{TKey}}

public bool Remove(TKey key)

Remove a series by key.

Parameters

Name Type
key {TKey}

Returns

System.Boolean

public bool Remove(DataSeries<TKey> series)

Remove a series.

Parameters

Name Type
series ChartGuru.DataSeries{{TKey}}

Returns

System.Boolean

public void Clear()

Remove all series.

public bool ContainsKey(TKey key)

Check if a series with the given key exists.

Parameters

Name Type
key {TKey}

Returns

System.Boolean

public bool TryGetSeries(TKey key, out DataSeries<TKey> series)

Try to get a series by key.

Parameters

Name Type
key {TKey}
series ChartGuru.DataSeries{{TKey}}

Returns

System.Boolean

public IEnumerable<DataSeries<TKey>> GetVisibleSeries()

Get all visible series.

Returns

System.Collections.Generic.IEnumerable{ChartGuru.DataSeries{{TKey}}}

public void ClearDirty()

Clear dirty flags on all series after rendering.

public IEnumerator<DataSeries<TKey>> GetEnumerator()

Enumerates series in collection order without copying them.

Returns

System.Collections.Generic.IEnumerator{ChartGuru.DataSeries{{TKey}}}

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Section titled “OnCollectionChanged(NotifyCollectionChangedEventArgs)”
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

Maintains series indices and forwards collection changes to registered listeners.

Parameters

Name Type
e System.Collections.Specialized.NotifyCollectionChangedEventArgs
public void Dispose()

Releases resources owned by this Series Collection; callers should not use the instance afterward.

public SeriesCollection()

public int Count { get; }

Number of series in the collection.

Returns

System.Int32

public int TotalPointCount { get; }

Total number of data points across all series.

Returns

System.Int32

public bool IsDirty { get; }

Whether any series has pending changes.

Returns

System.Boolean

public float MinY { get; }

Minimum Y value across all series.

Returns

System.Single

public float MaxY { get; }

Maximum Y value across all series.

Returns

System.Single

public float MinX { get; }

Minimum X value across all series.

Returns

System.Single

public float MaxX { get; }

Maximum X value across all series.

Returns

System.Single

public DataSeries<TKey> this[int index] { get; }

Parameters

Name Type
index System.Int32

Returns

ChartGuru.DataSeries{{TKey}}

public DataSeries<TKey> this[TKey key] { get; }

Parameters

Name Type
key {TKey}

Returns

ChartGuru.DataSeries{{TKey}}

public event NotifyCollectionChangedEventHandler CollectionChanged

Raised after series are inserted, removed, replaced, or reset.

Returns

System.Collections.Specialized.NotifyCollectionChangedEventHandler

public event Action<SeriesCollection<TKey>> DataChanged

Raised when collection structure or any contained series data changes.

Returns

System.Action{ChartGuru.SeriesCollection`1}