ChartTabularData
public sealed class ChartTabularDataLightweight, in-memory tabular dataset shared by every ChartGuru file
and live data source. Produced by ChartGuru.DataSources.Parsers.CsvParser
and ChartGuru.DataSources.Parsers.JsonToTabular; consumed
by ChartDataFrame.FromTabular(ChartTabularData, string, CultureInfo).
The model is intentionally narrow — strings on disk, typed lookups via
helper methods. This keeps parsing cheap (no boxing of every cell into
object) and lets the mapping layer convert lazily based on the
chosen ChartColumnType.
Fields
Section titled “Fields”
public static readonly ChartTabularData EmptyEmpty singleton — handy null-object for failed parses.
Returns
ChartGuru.ChartTabularData
Constructors
Section titled “Constructors”
ChartTabularData(string[], ChartColumnType[], string[], int)
Section titled “ChartTabularData(string[], ChartColumnType[], string[], int)”public ChartTabularData(string[] columns, ChartColumnType[] types, string[] cells, int rowCount)Creates a row-major table and precomputes numeric lookups, reading invariant numbers with the comma rules of automatic CSV parsing. Supplied arrays are retained rather than copied; null arrays become empty arrays.
Parameters
| Name | Type |
|---|---|
columns | System.String[] |
types | ChartGuru.ChartColumnType[] |
cells | System.String[] |
rowCount | System.Int32 |
Methods
Section titled “Methods”
IndexOf(string)
Section titled “IndexOf(string)”public int IndexOf(string columnName)Returns the index of the named column, or -1.
Parameters
| Name | Type |
|---|---|
columnName | System.String |
Returns
System.Int32
GetCell(int, int)
Section titled “GetCell(int, int)”public string GetCell(int row, int col)Raw cell text at [row, col].
Parameters
| Name | Type |
|---|---|
row | System.Int32 |
col | System.Int32 |
Returns
System.String
GetFloat(int, int, float)
Section titled “GetFloat(int, int, float)”public float GetFloat(int row, int col, float fallback = 0)Parse a cell as float in the table’s number format. Returns fallback on failure.
Parameters
| Name | Type |
|---|---|
row | System.Int32 |
col | System.Int32 |
fallback | System.Single |
Returns
System.Single
TryGetFloat(int, int, out float)
Section titled “TryGetFloat(int, int, out float)”public bool TryGetFloat(int row, int col, out float value)Reads a number in the table’s format without conflating an invalid cell with a caller-provided fallback.
Parameters
| Name | Type |
|---|---|
row | System.Int32 |
col | System.Int32 |
value | System.Single |
Returns
System.Boolean
TryGetDateTime(int, int, string, CultureInfo, out DateTime)
Section titled “TryGetDateTime(int, int, string, CultureInfo, out DateTime)”public bool TryGetDateTime(int row, int col, string format, CultureInfo culture, out DateTime value)Parse a cell as DateTime using format (or any standard format).
Parameters
| Name | Type |
|---|---|
row | System.Int32 |
col | System.Int32 |
format | System.String |
culture | System.Globalization.CultureInfo |
value | System.DateTime |
Returns
System.Boolean
EnumerateRows()
Section titled “EnumerateRows()”public IEnumerable<ChartTabularRow> EnumerateRows()Iterates rows. Each yielded item is bound to the underlying storage; do not capture across iterations.
Returns
System.Collections.Generic.IEnumerable{ChartGuru.ChartTabularRow}
ShapeEquals(ChartTabularData, ChartTabularData)
Section titled “ShapeEquals(ChartTabularData, ChartTabularData)”public static bool ShapeEquals(ChartTabularData a, ChartTabularData b)Compares the shape of two datasets — column names, column types,
and row count. Used by the diff fast-path to decide between
Chart.SetValues() (shape unchanged) and Chart.SetData().
Parameters
| Name | Type |
|---|---|
a | ChartGuru.ChartTabularData |
b | ChartGuru.ChartTabularData |
Returns
System.Boolean
Properties
Section titled “Properties”
Columns
Section titled “Columns”public string[] Columns { get; }Column display names (header row, or generated Col1..ColN).
Returns
System.String[]
public ChartColumnType[] Types { get; }Inferred type for each column — same length as ChartTabularData.Columns.
Returns
ChartGuru.ChartColumnType[]
public string[] Cells { get; }Row-major cell storage. Cells[r * ColumnCount + c].
Returns
System.String[]
RowCount
Section titled “RowCount”public int RowCount { get; }Number of data rows (excludes the header).
Returns
System.Int32
ColumnCount
Section titled “ColumnCount”public int ColumnCount { get; }Number of columns.
Returns
System.Int32