Skip to main content
Version: 5.11.6

GetChartList

public BackendReturnObject GetChartList();

Description

Looks up charts registered in BACKND Console.
A chart is data from the Excel file uploaded to and applied in the chart management section of BACKND Console.

Upon lookup, the chart name, chart ID/UUID, and the chart's version are returned, and chart data is not included.

Example

Synchronous

Backend.Chart.GetChartList();

Asynchronous

Backend.Chart.GetChartList((callback) => 
{
// Post-process
});

SendQueue

SendQueue.Enqueue(Backend.Chart.GetChartList, (callback) => 
{
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

GetReturnValuetoJSON

{
rows:
[
// version 1(old)
// When selectedChartFile does not exist
{
// Chart uuid
uuid: { S: "538b3a20-7b7a-11e8-8002-f31a1dd37719" },
// Chart indate
inDate: { S: "2018-06-29T08:56:35.266Z" },
// Chart description
chartExplain: { S: "2" },
// Chart name
chartName: { S: "v1" },
// version information(y: version1, n: version2)
old: { S: "y" }
},
// version 1(old)
// When selectedChartFile exists
{
// File information applied to the chart
selectedChartFile:
{
M:
{
// Number of rows in the chart
count: { N: "1000" },
// Chart file uuid
uuid: { S: "780932f0-75fb-11e8-bf7a-cbcc37090d69" },
// Chart file indate
inDate: { S: "2018-06-22T09:05:54.591Z" },
// Chart file name
chartFileName: { S: "222222.xlsx" }
}
},
// Chart indate
inDate: { S: "2018-06-22T09:05:38.562Z" },
// Chart uuid
uuid: { S: "6e7b5e20-75fb-11e8-bf7a-cbcc37090d69" },
// Chart description
chartExplain: { S: "v1" },
// Chart name(used when saving the chart content for selectedChartFile to PlayerPrefs)
chartName: { S: "23" },
// version information(y: version1, n: version2)
old: { S: "y" }
},
// version 2(new)
// When selectedChartFile does not exist
{
// Chart name
chartName: { S: "gggg" },
// Chart description
chartExplain: { NULL: true },
// Applied chart file id(if non-existent)
selectedChartFileId: { NULL: true },
// version information(y: version1, n: version2)
old: { S: "n" }
},
// version 2(new)
// When selectedChartFile exists
{
// Chart name
chartName: { S: "Heyhey" },
// Chart description
chartExplain: { NULL: true },
// Applied chart file id(if present)
selectedChartFileId: { N: "47" },
// version information(y: version1, n: version2)
old: { S: "n" }
}
]
}

Sample code

public class ChartCard
{
public bool isChartUpload = true; //Whether the chart is applied(value does not exist in returnValue)
public string chartName; // Chart name
public string chartExplain; // Chart description
public int selectedChartFileId;// Chart file ID
public string old; // Whether it is a new version

public override string ToString()
{
return $"chartName: {chartName}\n" +
$"chartExplain: {chartExplain}\n" +
$"isChartUpload: {isChartUpload}\n" +
$"selectedChartFileId: {selectedChartFileId}\n" +
$"old: {old}\n";
}
}

public void GetChartListTest()
{
var bro = Backend.Chart.GetChartList();

if(!bro.IsSuccess())
{
Debug.LogError("An error occurred : " + bro.ToString());
return;
}

List<ChartCard> chartCardList = new List<ChartCard>();

LitJson.JsonData json = bro.FlattenRows();

for(int i = 0; i < json.Count; i++)
{
ChartCard chartCard = new ChartCard();

chartCard.chartName = json[i]["chartName"].ToString();
chartCard.chartExplain = json[i]["chartExplain"].ToString();
int outNum = 0;

if(int.TryParse(json[i]["selectedChartFileId"].ToString(), out outNum))
{
chartCard.isChartUpload = true;
chartCard.selectedChartFileId = outNum;
}
else
{
chartCard.isChartUpload = false;
chartCard.selectedChartFileId = 0;
}

chartCard.old = json[i]["old"].ToString();

chartCardList.Add(chartCard);
}

foreach(var chartCard in chartCardList)
{
Debug.Log(chartCard.ToString() + "\n");
}
}