IChartSeriesData interface Pro
Common read surface for a chart series: name, drawing kind, colour and the typed value span (Michael's S9 decision: the value path stays double[]/ ReadOnlySpan, never a boxed per-value indexer). Deliberately NOT Values (an IReadOnlyList) — that stays on ChartSeries only, see its own remarks.
ChartModel and ChartDefinition hold series through this interface so a plain and a StreamingChartSeries take the same code path without caring which one they have. It is an INTERFACE, not a shared base class, because ChartSeries is a record (a C# record can only derive from object or another record — CS8864) and StreamingChartSeries must NOT be one: a mutating buffer under record value semantics drifts after every Append, and worse, a with on it could replace the buffer with one of another length, silently breaking the FIFO invariant (Append's window arithmetic assumes the buffer it allocated). No code in this repository uses with on a chart series (checked before this design), so losing it for the streaming case costs nothing.
public interface IChartSeriesData
- Namespace
- ArionUI.Charts
- Package
- ArionUI.Charts ·
dotnet add package ArionUI.Charts --prerelease
Properties
Axis
ChartAxis Axis { get; }Which Y axis this series is measured against.
Color
Rgba? Color { get; }
Count
int Count { get; }How many values this series currently holds.
Kind
ChartSeriesKind Kind { get; }
Name
string Name { get; }
Span
ReadOnlySpan<double> Span { get; }The series' values as a span: the typed path the scale scan and the plot decimation use, no interface-indexer per value.
StackGroup
string? StackGroup { get; }Name of the stack this series belongs to, or null when it stands on its own.
Column series that share a name and an axis are drawn on top of each other and scaled by their SUM; the stacks themselves stand side by side, like ungrouped columns do. Only columns can stack — ChartModel refuses a stack group on any other kind rather than quietly ignoring it.
