DataSeries<TKey>
public class DataSeries<TKey>Ordered numeric series with an optional display name and source values for plot construction.
Constructors
Section titled “Constructors”
DataSeries()
Section titled “DataSeries()”public DataSeries()
DataSeries(TKey)
Section titled “DataSeries(TKey)”public DataSeries(TKey key)Creates an empty series and derives its initial display name from the series key.
Parameters
| Name | Type |
|---|---|
key |
{TKey} |
DataSeries(TKey, IEnumerable)
Section titled “DataSeries(TKey, IEnumerable)”public DataSeries(TKey key, IEnumerable<DataPoint> points)Creates a keyed series and imports points in enumeration order, assigning series metadata and missing identities.
Parameters
| Name | Type |
|---|---|
key |
{TKey} |
points |
System.Collections.Generic.IEnumerable{ChartGuru.DataPoint} |
DataSeries(TKey, Color)
Section titled “DataSeries(TKey, Color)”public DataSeries(TKey key, Color color)Creates an empty keyed series with an explicit mark color.
Parameters
| Name | Type |
|---|---|
key |
{TKey} |
color |
UnityEngine.Color |
Methods
Section titled “Methods”
Add(DataPoint)
Section titled “Add(DataPoint)”public void Add(DataPoint point)Appends a point, assigns this series index and a missing identity, updates bounds, and raises collection and data notifications.
Parameters
| Name | Type |
|---|---|
point |
ChartGuru.DataPoint |
Add(float, float)
Section titled “Add(float, float)”public void Add(float x, float y)Creates and appends a point at the supplied coordinates using the normal identity and notification behavior.
Parameters
| Name | Type |
|---|---|
x |
System.Single |
y |
System.Single |
AddRange(IEnumerable)
Section titled “AddRange(IEnumerable)”public void AddRange(IEnumerable<DataPoint> points)Appends points in enumeration order, assigns series metadata and missing identities, then raises one reset notification.
Parameters
| Name | Type |
|---|---|
points |
System.Collections.Generic.IEnumerable{ChartGuru.DataPoint} |
AddRange(IEnumerable<(float x, float y)>)
Section titled “AddRange(IEnumerable<(float x, float y)>)”public void AddRange(IEnumerable<(float x, float y)> points)Creates and appends one point for each coordinate pair in enumeration order.
Parameters
| Name | Type |
|---|---|
points |
System.Collections.Generic.IEnumerable{System.ValueTuple{System.Single,System.Single}} |
RemoveAt(int)
Section titled “RemoveAt(int)”public void RemoveAt(int index)Removes the entry at the supplied index, updates series indices, and raises change notifications.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
Clear()
Section titled “Clear()”public void Clear()Removes all points, resets cached bounds, and raises reset and data-change notifications.
GetNativeData(Allocator)
Section titled “GetNativeData(Allocator)”public NativeList<DataPoint> GetNativeData(Allocator allocator = 3)Returns the series-owned native point buffer, allocating it with the requested allocator on first use and synchronizing it after managed data changes. Callers must not dispose the returned buffer; dispose the series to release it.
Parameters
| Name | Type |
|---|---|
allocator |
Unity.Collections.Allocator |
Returns
Unity.Collections.NativeList{ChartGuru.DataPoint}
CopyToNative(ref NativeList)
Section titled “CopyToNative(ref NativeList)”public void CopyToNative(ref NativeList<DataPoint> destination)Copies current numeric values into a caller-owned native array without changing series state.
Parameters
| Name | Type |
|---|---|
destination |
Unity.Collections.NativeList{ChartGuru.DataPoint} |
ClearDirty()
Section titled “ClearDirty()”public void ClearDirty()Clears dirty from this Data Series without changing unrelated configuration.
GetEnumerator()
Section titled “GetEnumerator()”public IEnumerator<DataPoint> GetEnumerator()Enumerates points in insertion order without copying the series.
Returns
System.Collections.Generic.IEnumerator{ChartGuru.DataPoint}
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Section titled “OnCollectionChanged(NotifyCollectionChangedEventArgs)”protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)Forwards collection changes as series data changes after maintaining entry indices.
Parameters
| Name | Type |
|---|---|
e |
System.Collections.Specialized.NotifyCollectionChangedEventArgs |
Dispose()
Section titled “Dispose()”public void Dispose()Releases resources owned by this Data Series; callers should not use the instance afterward.
Properties
Section titled “Properties”
public TKey Key { get; set; }Returns
{TKey}
public string Name { get; set; }Returns
System.String
public Color Color { get; set; }Returns
UnityEngine.Color
Visible
Section titled “Visible”public bool Visible { get; set; }Returns
System.Boolean
SeriesIndex
Section titled “SeriesIndex”public int SeriesIndex { get; }Returns
System.Int32
public int Count { get; }Returns
System.Int32
IsDirty
Section titled “IsDirty”public bool IsDirty { get; }Returns
System.Boolean
public float MinY { get; }Returns
System.Single
public float MaxY { get; }Returns
System.Single
public float MinX { get; }Returns
System.Single
public float MaxX { get; }Returns
System.Single
this[int]
Section titled “this[int]”public DataPoint this[int index] { get; set; }Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
Returns
ChartGuru.DataPoint
Events
Section titled “Events”
CollectionChanged
Section titled “CollectionChanged”public event NotifyCollectionChangedEventHandler CollectionChangedRaised after entries are inserted, removed, replaced, or reset.
Returns
System.Collections.Specialized.NotifyCollectionChangedEventHandler
DataChanged
Section titled “DataChanged”public event Action<DataSeries<TKey>> DataChangedRaised after series values or metadata change and attached charts should refresh.
Returns
System.Action{ChartGuru.DataSeries`1}