Leaderlines still visible

Hi All,

Do you know why the leader lines are still visible whereas I disabled it via code:

var pathWorkbook = @"...\\TestHadrienDataLabel.xlsx";
            var pathWorkbookNew = @"...\\TestHadrienDataLabelBis.xlsx";
            var wbtest = new Workbook(pathWorkbook);
            Worksheet sheettest = wbtest.Worksheets[0];
            Chart charttest = sheettest.Charts[0];

            charttest.Calculate(); 

            var lastPointIndex = charttest.NSeries[0].Points.Count - 1;
            var dataLabels = charttest.NSeries[0].Points[lastPointIndex].DataLabels;

            dataLabels.XRatioToChart = 0.8;
            dataLabels.YRatioToChart = 0.3;


            // Set the label to display the value
            dataLabels.ShowValue = true;

            // disable the leaderlines
            charttest.NSeries[0].HasLeaderLines = false;

            wbtest.Save(pathWorkbookNew);

It seems linked to the fact that I changed the endpoint position but in Excel I am able to remove the leaderlines manually by unchecking this checkbox:
image.png (29.2 KB)

TestHadrienDataLabel (2).zip (23.6 KB)

Thanks,
Hadrien

@hormancey

It seems that you are experiencing an issue where the leader lines in your chart remain visible even after you have set HasLeaderLines to false. This can sometimes occur due to the way the chart is rendered or updated after making changes to the data labels or their positions.

Here are a few suggestions to troubleshoot and potentially resolve the issue:

  1. Ensure Proper Calculation: After making changes to the chart properties, ensure that you call the Calculate() method on the chart to refresh its display. You have already included this in your code, but double-check that it is being executed after setting HasLeaderLines to false.

  2. Check Data Label Positioning: If you have modified the position of the data labels, it might affect the visibility of the leader lines. Make sure that the data labels are positioned correctly and that their new positions do not inadvertently cause the leader lines to appear.

  3. Revisit the Chart Type: Sometimes, certain chart types may behave differently with leader lines. If possible, try creating a different type of chart to see if the issue persists.

  4. Manual Adjustment: As you mentioned, in Excel, you can manually uncheck the leader lines option. If the programmatic approach does not work, consider implementing a workaround where you manually adjust the chart properties after saving it, or check if there are any additional properties related to leader lines that need to be set.

  5. Update Aspose.Cells: Ensure that you are using the latest version of Aspose.Cells, as bugs and issues are often resolved in newer releases.

If these suggestions do not resolve the issue, you may want to check the Aspose.Cells documentation or community forums for similar cases, as other users may have encountered and resolved this problem.

If you have any further questions or need additional assistance, feel free to ask!

The calculate after the setting hasleaderlines to false do not solve the problem.
At my end this behavior is not expected. The leaderlines should be disabled and it is possible in excel without changing the X Y position of the end value…

@hormancey,

Thanks for providing us template Excel file and details.

After initial testing, I am able to reproduce the issue as you mentioned by using your template Excel file and sample code snippet. I found leader lines are still visible in the chart (in the output Excel file) even we have disabled in code.

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-58433

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.

1 Like

@hormancey,

We are pleased to inform you that your issue (Ticket ID: “CELLSNET-58433”) has been resolved. The fix/enhancement will be included in the upcoming release (Aspose.Cells v25.7) that we plan to release in the first half of July 2025. You will be notified when the next version is published.

The issues you have found earlier (filed as CELLSNET-58433) have been fixed in this update. This message was posted using Bugs notification tool by leoluo