Skip to content

CsvChartDataSource

ClassChartGuruChartGuru
[AddComponentMenu("ChartGuru/Data Sources/CSV Chart Data Source")]
[DisallowMultipleComponent]
public sealed class CsvChartDataSource : ChartFileDataSourceBase, IChartDataSource

Reads 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`).

public ChartFileSourceMode SourceMode { get; set; }

No description is available for this member.

Returns

ChartGuru.ChartFileSourceMode — No return description is available.

public TextAsset TextAsset { get; set; }

No description is available for this member.

Returns

UnityEngine.TextAsset — No return description is available.

public string ProjectPath { get; set; }

No description is available for this member.

Returns

System.String — No return description is available.

public string AbsolutePath { get; set; }

No description is available for this member.

Returns

System.String — No return description is available.

public string StreamingAssetsPath { get; set; }

No description is available for this member.

Returns

System.String — No return description is available.

public string InlineText { get; set; }

No description is available for this member.

Returns

System.String — No return description is available.

public bool WatchFileAtRuntime { get; set; }

Toggle runtime file watching. Disposes the watcher when set to false.

Returns

System.Boolean — No return description is available.

protected override string LoadText()

Subclasses override to obtain the raw text payload synchronously. Return an empty string to signal “no data”.

Returns

System.String — No return description is available.

protected override ChartTabularData ParseToTabular(string rawText)

Convert raw text to a ChartGuru.ChartTabularData. Implemented per source (CSV vs JSON).

Parameters

Name Type Description
rawText System.String

Returns

ChartGuru.ChartTabularData — No return description is available.

public void LoadFromText(string csvText)

Set inline CSV text and immediately refresh. Convenience shortcut for SourceMode = InlineText; InlineText = …; Refresh();.

Parameters

Name Type Description
csvText System.String
public void LoadAsset(TextAsset asset)

Set a TextAsset source and immediately refresh. Convenience shortcut for SourceMode = TextAsset; TextAsset = …; Refresh();.

Parameters

Name Type Description
asset UnityEngine.TextAsset
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.

protected override void OnEnable()

No description is available for this member.