How to group data in Tremap Chart with Aspose.Cells

Hi, I’m trying to group display on treemap chart based on column name. All I need to do is sort the data table so that the column I want to group is grouped by the data on that column, right?
For example I have original table:
NAME BRAND PRICE
A 10A5 41.69
A 11A5 52.15
A 10A5 47.51
B 10A6 22.69
B 11A6 32.56
B 10A6 27.34
A 12A5 36.86
A 12A5 50.23
A 11A5 45.67
B 12A6 46.86
B 12A6 30.57
B 11A6 35.67
B 10A6 37.45
B 11A6 37.57
B 10A6 40.5

The table I need to transform into to group the data:
NAME BRAND PRICE
A 10A5 41.69
A 11A5 52.15
A 10A5 47.51
A 12A5 36.86
A 12A5 50.23
A 11A5 45.67
B 10A6 22.69
B 11A6 32.56
B 10A6 27.34
B 12A6 46.86
B 12A6 30.57
B 11A6 35.67
B 10A6 37.45
B 11A6 37.57
B 10A6 40.5

Thanks a lot.

@quanggiap299,

You may use Aspose.Cells Cloud APIs to build a list object and sort the list object.

Please refer to following codes:

        string filename = "Group.xlsx";
        ReadyFile(filename);
        var url = BuildUrl(string.Format("{0}/worksheets/book1/listobjects?startRow=0&startColumn=0&endRow=14&endColumn=2&folder={1}", filename,  TempFolderPath));
        string bodyParam = null;
        Dictionary<string, string> headParams = null;
        Dictionary<string, object> formParams = null;
        var response = ApiInvoker.InvokeApiAsync<dynamic>(url, "PUT", bodyParam, headParams, formParams).Result;
        Assert.AreEqual(HttpStatusCode.OK.ToString(), (string)response.Status.Value);
        DTO.DataSorter dataSorter = new DTO.DataSorter();
        dataSorter.HasHeaders = false;
        DTO.SortKey sortKey = new DTO.SortKey();
        sortKey.Index = 0;
        sortKey.Order = "Ascending";
        dataSorter.KeyList.Add(sortKey);
        bodyParam = JsonConvert.SerializeObject(dataSorter);
        url = BuildUrl(string.Format("{0}/worksheets/book1/listobjects/0/sort?folder={1}", filename, TempFolderPath));
        response = ApiInvoker.InvokeApiAsync<dynamic>(url, "POST", bodyParam, headParams, formParams).Result;
        Assert.AreEqual(HttpStatusCode.OK.ToString(), (string)response.Status.Value);

@quanggiap299,

You may use Aspose.Cells Cloud APIs to build sheet data sort.

Please refer to online documents and following codes:
var url = BuildUrl(string.Format(“{0}/worksheets/{1}/sort?cellarea=A1:C14&folder={2}”, GroupXlsx, “book1”, TempFolderPath));
string bodyParam = null;
Dictionary<string, string> headParams = null;
Dictionary<string, object> formParams = null;
DTO.DataSorter dataSorter = new DTO.DataSorter();
dataSorter.HasHeaders = false;
DTO.SortKey sortKey = new DTO.SortKey();
sortKey.Index = 0;
sortKey.Order = “Ascending”;
dataSorter.KeyList.Add(sortKey);
bodyParam = JsonConvert.SerializeObject(dataSorter);
var response = ApiInvoker.InvokeApiAsync(url, “POST”, bodyParam, headParams, formParams).Result;
Assert.IsNotNull(response);