CsvChartDataSource
[AddComponentMenu("ChartGuru/Data Sources/CSV Chart Data Source")][DisallowMultipleComponent]public sealed class CsvChartDataSource : ChartFileDataSourceBase, IChartGuruElementDataSource, IChartDataSourceReads CSV (or any separated-values text) from a TextAsset, project file, absolute path, StreamingAssets file, or inline string and pushes it to one or more target charts. Auto-detects delimiter, header row, and column types — but everything is overridable in the inspector.
Optionally watches the source file with a FileSystemWatcher
(Editor-only by default; opt-in at runtime via `ChartGuru.CsvChartDataSource.WatchFileAtRuntime`).
Methods
Section titled “Methods”
LoadText()
Section titled “LoadText()”protected override string LoadText()Subclasses override to obtain the raw text payload synchronously. Return an empty string to signal “no data”.
Returns
System.String
ParseToTabular(string)
Section titled “ParseToTabular(string)”protected override ChartTabularData ParseToTabular(string rawText)Convert raw text to a ChartGuru.ChartTabularData. Implemented per source (CSV vs JSON).
Parameters
| Name | Type |
|---|---|
rawText |
System.String |
Returns
ChartGuru.ChartTabularData
LoadFromText(string)
Section titled “LoadFromText(string)”public void LoadFromText(string csvText)Set inline CSV text and immediately refresh. Convenience shortcut for
SourceMode = InlineText; InlineText = …; Refresh();.
Parameters
| Name | Type |
|---|---|
csvText |
System.String |
LoadAsset(TextAsset)
Section titled “LoadAsset(TextAsset)”public void LoadAsset(TextAsset asset)Set a TextAsset source and immediately refresh. Convenience shortcut for
SourceMode = TextAsset; TextAsset = …; Refresh();.
Parameters
| Name | Type |
|---|---|
asset |
UnityEngine.TextAsset |
AutoDetectFormat()
Section titled “AutoDetectFormat()”public bool AutoDetectFormat()Read the configured source, auto-detect a sensible delimiter and
header mode, and write the results into _delimiterOverride /
_headerMode. Designed for the inspector “Auto Detect Format”
button — call once after picking a file to lock in explicit values
instead of relying on per-parse auto-detection (which can flip
between commits when data changes).
Returns
System.Boolean: True when detection succeeded and at least one field was updated.
Constructors
Section titled “Constructors”
CsvChartDataSource()
Section titled “CsvChartDataSource()”public CsvChartDataSource()Properties
Section titled “Properties”
SourceMode
Section titled “SourceMode”public ChartFileSourceMode SourceMode { get; set; }Returns
ChartGuru.ChartFileSourceMode
TextAsset
Section titled “TextAsset”public TextAsset TextAsset { get; set; }Returns
UnityEngine.TextAsset
ProjectPath
Section titled “ProjectPath”public string ProjectPath { get; set; }Returns
System.String
AbsolutePath
Section titled “AbsolutePath”public string AbsolutePath { get; set; }Returns
System.String
StreamingAssetsPath
Section titled “StreamingAssetsPath”public string StreamingAssetsPath { get; set; }Returns
System.String
InlineText
Section titled “InlineText”public string InlineText { get; set; }Returns
System.String
WatchFileAtRuntime
Section titled “WatchFileAtRuntime”public bool WatchFileAtRuntime { get; set; }Toggle runtime file watching. Disposes the watcher when set to false.
Returns
System.Boolean