public void Cells_Charts_Tests() { try { storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/cells-sample.xlsx", Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx"); CellsChartsResponse CellsChartsResponse = cellsService.Charts.GetWorksheetChartsInfo(name, "sheet4", Utils.CloudStorage_Output_Folder); CellsChartResponse cellsChartResponse = cellsService.Charts.GetChartInfo(name, "sheet4", 0, Utils.CloudStorage_Output_Folder); cellsService.Charts.AddChartTitle(name, "sheet4", 0, cellsChartResponse.Chart, Utils.CloudStorage_Output_Folder); cellsService.Charts.GetChartInSomeFormat(name, "sheet4", 0, CellsChartOutputFormat.Bmp, Utils.CloudStorage_Output_Folder, Utils.Local_Output_Path + "cells-chart-out.bmp"); cellsService.Charts.ShowLegendInChart(name, "sheet4", 0, Utils.CloudStorage_Output_Folder); cellsService.Charts.HideLegendInChart(name, "sheet4", 0, Utils.CloudStorage_Output_Folder); cellsService.Charts.HideTitleInChart(name, "sheet4", 0, Utils.CloudStorage_Output_Folder); CellsChartLegendResponse cellsChartLegendResponse = cellsService.Charts.GetChartLegend(name, "sheet4", 0, Utils.CloudStorage_Output_Folder); //cellsService.Charts.UpdateChartLegend(name, "sheet4", 0, Utils.CloudStorage_Output_Folder, cellsChartLegendResponse.Legend); cellsService.Charts.SetChartTitleVisible(name, "sheet4", 0, cellsChartResponse.Chart, Utils.CloudStorage_Output_Folder); cellsService.Charts.UpdateChartTitle(name, "sheet4", 0, cellsChartResponse.Chart, Utils.CloudStorage_Output_Folder); cellsService.Charts.AddNewChartToWorksheet(name, "sheet1", ChartType.Bar, 1, 1, 1, 1, "A1:F100", true, "", true, "Aspose.Cells for .NET", Utils.CloudStorage_Output_Folder); cellsService.Charts.DeleteWorksheetChartByIndex(name, "sheet4", 0, Utils.CloudStorage_Output_Folder); cellsService.Charts.ClearTheCharts(name, "sheet4", Utils.CloudStorage_Output_Folder); //storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx", Utils.Local_Output_Path + "/cells-sample.xlsx"); } catch (Exception ex) { Assert.Fail(ex.Message); } }
static void Main() { string dataDir = Common.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string input = "sample1.xlsx"; Common.StorageService.File.UploadFile(dataDir + input, input, storage: Common.STORAGE); string sheetName = "Sheet1"; CellsChartLegendResponse apiResponse = Common.CellsService.Charts.GetChartLegend(input, sheetName, 0, Common.FOLDER, storage: Common.STORAGE); Console.WriteLine(" Response Legend AutoSize: " + apiResponse.Legend.IsAutomaticSize); }
static void Main() { string dataDir = Common.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string input = "Sample1.xlsx"; string output = "output.xlsx"; string sheetName = "Sheet1"; Common.StorageService.File.UploadFile(dataDir + input, input, storage: Common.STORAGE); CellsChartLegendResponse cellsChartLegendResponse = Common.CellsService.Charts.GetChartLegend(input, sheetName, 0, Common.FOLDER); Common.CellsService.Charts.UpdateChartLegend(input, sheetName, 0, Common.FOLDER, cellsChartLegendResponse.Legend, storage: Common.STORAGE); Common.CellsService.Charts.ShowLegendInChart(input, sheetName, 0, Common.FOLDER, storage: Common.STORAGE); Common.StorageService.File.DownloadFile(input, dataDir + output, storage: Common.STORAGE); }