How to decrease the plot area for chart

Need assistance in decreasing plot area for a chart using Aspose.Cells for Java API.

Used the following link for changing the position & size of the chart but it is not reflected.

Attached sample excel with the chart for your reference.
SampleExcel.zip (8.8 KB)

Thanks in advance.

@SrideviG,

Please notice, I am able to reproduce the issue as you mentioned. I tried to minimize the plot area but to no avail. I used the following sample code with your template file but the plot area is not changed.
e.g.
Sample code:

         Workbook workbook = new Workbook("f:\\files\\SampleExcel.xls");

         Worksheet worksheet = workbook.getWorksheets().get(0);

         Chart chart = worksheet.getCharts().get(0);

         chart.getPlotArea().setY(833);
         chart.getPlotArea().setX(58);
         chart.getPlotArea().setHeight(2798);
         chart.getPlotArea().setWidth(2919);

         chart.calculate();


         workbook.save("f:\\files\\out1.xls");

I have logged a ticket with an id “CELLSJAVA-44812” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

1 Like

@SrideviG,

This is to inform you that your issue has been resolved. The fix will be included in the next official release (Aspose.Cells v22.9) which is scheduled to be released in the second week of September 2022. You will also be notified when the next version is published.

The issues you have found earlier (filed as CELLSJAVA-44812) have been fixed in this update. This message was posted using Bugs notification tool by Peyton.Xu

I’ve verified this with latest release. But its still same. the chart size is not getting updated.
Could you please take a look once

@SrideviG,

It works absolutely fine using the newer version. Please make sure you are using Aspose.Cells for Java v22.9. Here is my sample code using your original file:
e.g.
Sample code:

Workbook workbook = new Workbook("f:\\files\\SampleExcel.xls");

Worksheet worksheet = workbook.getWorksheets().get(0);

Chart chart = worksheet.getCharts().get(0);

chart.getPlotArea().setY(833);
chart.getPlotArea().setX(58);

chart.getPlotArea().setHeight(2798);
chart.getPlotArea().setWidth(2919);

chart.calculate();
workbook.save("f:\\files\\out1.xls");

Please find attached the output file in the zipped archive.
files1.zip (7.5 KB)