WebChartDataSource
[AddComponentMenu("ChartGuru/Data Sources/Web Chart Data Source")][DisallowMultipleComponent]public class WebChartDataSource : ChartFileDataSourceBase, IChartDataSourcePolls an HTTP/HTTPS endpoint on a configurable interval, decodes the response as CSV or JSON, and pushes the result through the standard mapping pipeline. Includes:
Properties
Section titled “Properties”
public string Url { get; set; }No description is available for this member.
Returns
System.String — No return description is available.
Headers
Section titled “Headers”public List<WebChartDataSource.HttpHeader> Headers { get; }No description is available for this member.
Returns
System.Collections.Generic.List{ChartGuru.WebChartDataSource.HttpHeader} — No return description is available.
Format
Section titled “Format”public WebDataFormat Format { get; set; }No description is available for this member.
Returns
ChartGuru.WebDataFormat — No return description is available.
JsonRootSelector
Section titled “JsonRootSelector”public string JsonRootSelector { get; set; }No description is available for this member.
Returns
System.String — No return description is available.
PollIntervalSeconds
Section titled “PollIntervalSeconds”public float PollIntervalSeconds { get; set; }No description is available for this member.
Returns
System.Single — No return description is available.
RunInEditMode
Section titled “RunInEditMode”public bool RunInEditMode { get; set; }No description is available for this member.
Returns
System.Boolean — No return description is available.
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 — No return description is available.
LoadTextAsync(CancellationToken)
Section titled “LoadTextAsync(CancellationToken)”protected override Task<string> LoadTextAsync(CancellationToken ct)Async variant. The default implementation invokes ChartGuru.ChartFileDataSourceBase.LoadText
on a thread-pool worker. Subclasses with a true async pipeline
(UnityWebRequest, file-stream ReadAsync) should override.
Parameters
| Name | Type | Description |
|---|---|---|
ct |
System.Threading.CancellationToken |
Returns
System.Threading.Tasks.Task{System.String} — No return description is available.
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 | Description |
|---|---|---|
rawText |
System.String |
Returns
ChartGuru.ChartTabularData — No return description is available.
ApplyData()
Section titled “ApplyData()”public override void ApplyData()Sync entry points (inspector “Fetch Now” button, ApplyData, Refresh) all
route through the async pipeline because ChartGuru.WebChartDataSource.LoadText on a
network source can’t return a synchronous string. Without this override
the inherited ChartGuru.ChartFileDataSourceBase.ApplyData would call
ChartGuru.WebChartDataSource.LoadText (returns “”) and silently do nothing.
Load(string)
Section titled “Load(string)”public void Load(string url)Set a URL and immediately fetch. Convenience shortcut for
Url = …; Refresh();.
Parameters
| Name | Type | Description |
|---|---|---|
url |
System.String | |
ForceFetch()
Section titled “ForceFetch()”public void ForceFetch()Unconditional fetch — bypasses the ChartGuru.WebChartDataSource.RunInEditMode guard.
Used by the inspector “Fetch Now” button so the user can always pull
fresh data on demand.
Refresh()
Section titled “Refresh()”public override void Refresh()Drive a synchronous load → parse → push cycle. Equivalent to
ChartGuru.ChartFileDataSourceBase.ApplyData; provided as a more discoverable alias.
RefreshAsync(CancellationToken)
Section titled “RefreshAsync(CancellationToken)”public override Task RefreshAsync(CancellationToken ct = default)Async refresh. Loads + parses on a background thread, then marshals the apply step back to the captured Unity main-thread context. Cancellation is honored across each await boundary.
Parameters
| Name | Type | Description |
|---|---|---|
ct |
System.Threading.CancellationToken |
Returns
System.Threading.Tasks.Task — No return description is available.
OnEnable()
Section titled “OnEnable()”protected override void OnEnable()No description is available for this member.
OnValidate()
Section titled “OnValidate()”protected override void OnValidate()No description is available for this member.