I have the problem that the data labels in a pie chart may overlap, depending on the data, and there seems to be no option in Excel to avoid this - at least that's my impression after some googling. So I tried to change the position of overlapping labels in my code.
I use an Excel file that contains the data and the chart already (see the attached Excel file). Here's my sample code, which should change the X position of the first label:
Workbook workbook = new Workbook(Server.MapPath("_AsposeTest.xlsx"));
Chart chart = workbook.Worksheets.Charts;
ChartPointCollection chartPoints = chart.NSeries.Points;
chartPoints.DataLabels.X += 50; // should shift the label to some amount to the right.
workbook.Save(Response, "_AsposeTest2.xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions());
But the label position does not change. And, what's really strange, after code execution all data labels include the data series name (see the attached screenshot), although the original Excel file does not show these names, because this is disabled the charts' options in the Excel file.
What am I doing wrong? Or is this a bug? I'm using Aspose.Cells 22.214.171.124 for ASP.NET in a web application.
[Edit:] I just found out that the behaviour shown in the screenshot occurs in Excel 2010, but not in Excel 2007.