GoogleSheetsChartDataSource
[AddComponentMenu("ChartGuru/Data Sources/Google Sheets Chart Data Source")][DisallowMultipleComponent]public sealed class GoogleSheetsChartDataSource : ChartFileDataSourceBase, IChartDataSourceConvenience wrapper around ChartGuru.WebChartDataSource that converts a Google Sheets share URL into the matching CSV-export URL, then pulls + parses it on a configurable interval. The recipe also handles the most common gotchas — choosing the right gid, requesting CSV export instead of HTML, and decoding UTF-8.
To use:
- In Google Sheets: File → Share → Publish to web.
- Paste the shared sheet URL into `ChartGuru.GoogleSheetsChartDataSource.ShareUrl` (or paste the spreadsheet ID into `ChartGuru.GoogleSheetsChartDataSource.SpreadsheetId` and set `ChartGuru.GoogleSheetsChartDataSource.SheetGid`).
- Optionally set `ChartGuru.GoogleSheetsChartDataSource.PollIntervalSeconds` > 0 to refresh periodically.
Properties
Section titled “Properties”
ShareUrl
Section titled “ShareUrl”public string ShareUrl { get; set; }No description is available for this member.
Returns
System.String — No return description is available.
SpreadsheetId
Section titled “SpreadsheetId”public string SpreadsheetId { get; set; }No description is available for this member.
Returns
System.String — No return description is available.
SheetGid
Section titled “SheetGid”public string SheetGid { 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.
ResolvedExportUrl
Section titled “ResolvedExportUrl”public string ResolvedExportUrl { get; }No description is available for this member.
Returns
System.String — No return description is available.
Methods
Section titled “Methods”
Load(string)
Section titled “Load(string)”public void Load(string shareUrl)Set a Google Sheets share URL and immediately refresh. Convenience shortcut for
ShareUrl = …; Refresh();.
Parameters
| Name | Type | Description |
|---|---|---|
shareUrl |
System.String | |
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.
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.
OnEnable()
Section titled “OnEnable()”protected override void OnEnable()No description is available for this member.
ExtractSpreadsheetId(string)
Section titled “ExtractSpreadsheetId(string)”public static string ExtractSpreadsheetId(string url)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
url |
System.String |
Returns
System.String — No return description is available.
ExtractGid(string)
Section titled “ExtractGid(string)”public static string ExtractGid(string url)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
url |
System.String |
Returns
System.String — No return description is available.