Skip to main content
Version: 5.11.8

GetLocalChartData

public string GetLocalChartData(string chartKey);

Parameter

ValueTypeDescription
chartKeyStringThe chart name, chart name specified by GetOneChartAndSave or the chart ID
may have different parameter values depending on which Key type they were saved through.

Description

Calls the chart file saved locally.
The value stored locally is the data of the Excel file uploaded from the chart management section of BACKND Console.

The method is returned as a string, and only synchronous types are supported.

Example

Synchronous

Backend.Chart.GetLocalChartData("chartKey");

Return cases

When the corresponding chartKey exists locally The content of the chart is returned in the form of a string.
Please see below for the return format.

When the corresponding chartKey does not exist locally
string.empty is returned.

When the chartKey is given as null or an empty string The 'chartKey must not be null or empty' exception is thrown.

Locally saved chart format

{
rows:
[
{
column1:{
S:"68a8b0f0-d336-11e7-8b06-4fc22765a737"
},
column2:{
S:"123123"
},
num:{
S:"1"
}
}
.......
]
}

How to use the called values

The stored value is a string in JSON format. It needs to be converted to a JsonObject for use.
BACKND uses LitJson, but you may use others.

LitJson.JsonData chartJson = JsonMapper.ToObject(Backend.Chart.GetLocalChartData(ChartName));

var rows = chartJson["rows"];

// Chart length
Debug.Log(rows.Count);

// Read the content of column1 of the 10th row in the chart
Debug.Log(rows[10]["column1"]["S"].ToString());