Custom DataLabels.Text not working

I am trying to add custom text to DataLables, and test code is below:

// Create a new workbook
Workbook workbook = new Workbook();

// Access the first worksheet in the workbook
Worksheet worksheet = workbook.Worksheets[0];

// Define your data
object[,] data = new object[,]
{
    { "Category", "S-55", "S-65", "S-70", "S-Column" },
    { "0%", 55, 10, 5, 0 },
    { "25%", 55, 10, 5, 0.12 },
    { "50%", 55, 10, 5, 0.45 },
    { "75%", 70, 5, 2.5, 0.42 },
    { "100%", 85, 0, 0, 0.1 }
};
// Get the range of cells where you want to set values
int startRow = 0;
int startColumn = 0;
int numRows = data.GetLength(0);
int numCols = data.GetLength(1);
var range = worksheet.Cells.CreateRange(startRow, startColumn, numRows, numCols);

// Set values from the array to the range
range.Value = data;
// Adding a chart to the worksheet
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.LineStacked, 5, 0, 25, 10);

// Accessing the instance of the newly added chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];
chart.ChartArea.BackgroundMode = BackgroundMode.Transparent;
chart.ValueAxis.MinValue = 45.0;
chart.ValueAxis.MaxValue = 90;
chart.ValueAxis.MajorUnit = 10;
chart.ValueAxis.MinorUnit = 10;
chart.SecondValueAxis.MinValue = 0;
chart.SecondValueAxis.MaxValue = 0.45;
chart.SecondValueAxis.MajorUnit = 0.1;
chart.SecondValueAxis.MinorUnit = 0.1;
chart.SecondValueAxis.MajorGridLines.IsVisible = false;
chart.PlotArea.Area.ForegroundColor = Color.White;

// Adding NSeries (chart data source) to the chart ranging
var series1 = chart.NSeries[chart.NSeries.Add("Sheet1!B2:B6", true)];
series1.Area.ForegroundColor = Color.Transparent;
var series2 = chart.NSeries[chart.NSeries.Add("Sheet1!C2:C6", true)];
series2.Area.FillFormat.FillType = Aspose.Cells.Drawing.FillType.Pattern;
series2.Area.FillFormat.PatternFill.Pattern = Aspose.Cells.Drawing.FillPattern.WideDownwardDiagonal;
series2.Area.FillFormat.PatternFill.ForegroundColor = Color.Green;
series2.Area.FillFormat.PatternFill.BackgroundColor = Color.White;

series2.Border.FormattingType = ChartLineFormattingType.Solid;
series2.Border.IsVisible = true;
series2.Border.WeightPt = 2;
series2.Border.Color = Color.Black;
var series3 = chart.NSeries[chart.NSeries.Add("Sheet1!D2:D6", true)];
series3.Area.FillFormat.FillType = Aspose.Cells.Drawing.FillType.Pattern;
series3.Area.FillFormat.PatternFill.Pattern = Aspose.Cells.Drawing.FillPattern.WideUpwardDiagonal;
series3.Area.FillFormat.PatternFill.ForegroundColor = Color.Red;
series3.Area.FillFormat.PatternFill.BackgroundColor = Color.White;
series3.Border.FormattingType = ChartLineFormattingType.Solid;
series3.Border.IsVisible = true;
series3.Border.WeightPt = 2;
series3.Border.Color = Color.Black;


var series4 = chart.NSeries[chart.NSeries.Add("Sheet1!E2:E6", true)];
series4.Area.ForegroundColor = Color.Gray;
series4.PlotOnSecondAxis = true;
series4.GapWidth = 0;
series4.Area.Transparency = 0.45;
series4.Border.FormattingType = ChartLineFormattingType.Solid;
series4.Border.IsVisible = true;
series4.Border.WeightPt = 0.75;
series4.Border.Color = Color.Black;

int pointCount = series4.Points.Count;
for (int i = 0; i < pointCount; i++)
{
    ChartPoint pointIndex = series4.Points[i];

    pointIndex.DataLabels.Text = "Series 1" + "\n" + "Point " + i;
}

series4.Points[0].DataLabels.IsAutoText = true;
series4.Points[0].DataLabels.Text = "65 Test (12%)";
series4.Points[1].DataLabels.Text = "65 Test (12%)";
series4.Points[1].DataLabels.IsAutoText = false;
series4.Points[2].DataLabels.Text = "65 Test (45%)";
series4.Points[3].DataLabels.Text = "75 Test (42%)";
series4.Points[4].DataLabels.Text = "85 Test (1%)";
// Setting the chart type of 2nd NSeries to display as line chart
chart.NSeries[0].Type = Aspose.Cells.Charts.ChartType.Column;
chart.NSeries[1].Type = Aspose.Cells.Charts.ChartType.LineStackedWithDataMarkers;
series1.Type = ChartType.AreaStacked;
series2.Type = ChartType.AreaStacked;
series3.Type = ChartType.AreaStacked;
series4.Type = ChartType.ColumnStacked;
//series4.Type = ChartType.Column;
//设置 NSeries列名称
chart.NSeries.CategoryData = "A2:A6";
series1.Name = "S-55";
series2.Name = "S-65";
series3.Name = "S-70";
series4.Name = "S-Column";

chart.SecondValueAxis.IsVisible = true;
chart.ShowLegend = false;
chart.CategoryAxis.AxisBetweenCategories = false;
foreach (Series series in chart.NSeries)
{
    series.GapWidth = 0;
}
//显示DataTable
// chart.ShowDataTable = true;
chart.CategoryAxis.Title.Text = "X";
chart.ValueAxis.Title.Text = "Y";
chart.SecondValueAxis.TickLabelPosition = TickLabelPositionType.None;
chart.SecondCategoryAxis.IsVisible = false;
chart.ValueAxis.MajorGridLines.IsVisible = false;
chart.PlotArea.Border.FormattingType = ChartLineFormattingType.None;
chart.SecondValueAxis.AxisLine.IsVisible = false;
// Save the workbook
workbook.Save("output.xlsx");

But, the DataLables always not showing for custom text.
Here is the expected result
image.png (39.2 KB)

@Meekou,

Thanks for the screenshot.

Please try the following lines of code to render data labels for the series in percentages (for their values).

series4.DataLabels.ShowValue = true;
series4.DataLabels.NumberFormat = "0%";

Hope, this helps a bit.