[Regression?] Location of PlotArea in charts is no longer calculated properly in recent Aspose.Cells

Hi,

We use on Aspose.Cells to move textboxes inside charts, in order to do this, we use the APIs to get the location of the plot area and move it accordingly.

However, it seems after Aspose migrated PlotArea.InnerX to chart.PlotArea.InnerXRatioToChart, this no longer works properly and consistently.

Below is an example code that attempts to move a textbox in the chart to the top left corner of the plot area:

        var workbook = new Workbook(@".\test.xlsx");
        Chart chart = workbook.Worksheets[0].Charts[0];
        chart.Calculate();
        Shape shapeToMove = chart.Shapes[0];

        //int left = chart.PlotArea.InnerX; // cells 24.10.0 
        //int top = chart.PlotArea.InnerY; // cells 24.10.0
        int left = (int)(chart.PlotArea.InnerXRatioToChart * 4000); // cells 25.6.0 -> same result in deprecated chart.PlotArea.InnerX in this version
        int top = (int)(chart.PlotArea.InnerYRatioToChart * 4000); // cells 25.6.0 -> same result in deprecated chart.PlotArea.InnerY in this version

        Console.WriteLine(left); // cells 24.10.0 - 202 / cells 25.6.0 - 245
        Console.WriteLine(top); // cells 24.10.0 - 638 / cells 25.6.0 - 643
        shapeToMove.LeftInShape = left; // move the text box to the left edge of the plot area
        shapeToMove.TopInShape = top; 
        workbook.Save(@".\moved.xlsx");

The InnerX value of the plot area is significantly different from the actual value, which resulted in an extra gap between the moved textbox and the actual top left corner of the plot area. This did not happen in older version of Aspose.Cells (e.g. 24.10.0)

This does not seem to behave consistently, in some other charts the InnerX value was calculated properly even in the most recent version.

I’ve attached the test files from both versions and a screenshot for your reference. Could you please check if this is a regression or if there’s a more reliable way in this version to move the boxes to a location relative to the plot area?

test.zip (212.6 KB)
image.png (42.3 KB)

Thanks,

@ServerSide527,

Thanks for the template Excel file and screenshot.

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 location of PlotArea in charts is no longer calculated properly in the recent Aspose.Cells version.

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

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.

@ServerSide527,

We are pleased to inform you that your issue (Ticket ID: “CELLSNET-58618”) 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.

Hi @ServerSide527

After optimization, our new output file is as follows, which will take effect in version 25.7.

NewOutput.zip (70.7 KB)

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