Please try to call Chart.Calculate() method before retrieving the category axis labels. I tested your scenario/case with your template Excel file and using latest version/fix: Aspose.Cells for .NET v25.5, it works fine and as expected.
e.g., Sample code:
Workbook workbook = new Workbook("e:\\test2\\4366-20250303.xlsx");
Worksheet sheet = workbook.Worksheets[3];
var chart = sheet.Charts.OrderByDescending(t => t.ChartObject.LowerRightRow).First();
chart.Calculate();
// Get the axis labels
string[] axisLabels = chart.CategoryAxis.GetAxisTexts();
// Print the axis labels to console
Console.WriteLine("Category Axis Labels:");
if (axisLabels != null)
{
foreach (var label in axisLabels)
{
Console.WriteLine(label);
}
}
I tested your scenario/case with your newly attached template Excel file using our latest version/fix: Aspose.Cells for .NET v25.5 (please try it), it works fine and as expected. I got the same output as shown in previous reply.
See the screenshot on how the category axis labels are shown in MS Excel (2019) on my end: sc_shot1.png (111.4 KB)
Thanks for providing further details and screenshots.
I simply opened your template Excel file into MS Excel and did your suggested change for the chart’s axis labels as per your screenshot. I re-saved the file as “4366-20250303_new1.xlsx”. I then tested your scenario/case with the the file and using latest version/fix: Aspose.Cells for .NET v25.5:
Workbook workbook = new Workbook("e:\\test2\\4366-20250303_new1.xlsx");
Worksheet sheet = workbook.Worksheets[3];
var chart = sheet.Charts.OrderByDescending(t => t.ChartObject.LowerRightRow).First();
chart.Calculate();
// Get the axis labels
string[] axisLabels = chart.CategoryAxis.GetAxisTexts();
// Print the axis labels to console
Console.WriteLine("Category Axis Labels:");
if (axisLabels != null)
{
foreach (var label in axisLabels)
{
Console.WriteLine(label);
}
}
So, the output is not matching with the axis labels of the chart as shown in MS Excel. We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-58452
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
We are currently looking into your issue and will check if we can provide the latest updates or an estimated timeframe for resolution. We will get back to you soon.
The issues you have found earlier (filed as CELLSNET-58452) have been fixed in this update. This message was posted using Bugs notification tool by leoluo