Please see the attached workbook generated by the Cells component (latest version).
Hi,
Please try the attached version. I have tested with it changing the top and left positions for your chart in the first sheet and it works fine.
e.g
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook();
workbook.Open(@“e:\test\xl.xls”);
Aspose.Cells.Chart chart = workbook.Worksheets[0].Charts[0];
chart.ChartObject.Top = 250;
chart.ChartObject.Left = 200;
workbook.Save(“e:\test\outxl2.xls”);
If you still find any issue, kindly paste your complete code here to show the issue, we will check it soon.
Thank you.
Amjad,
Hi Shaun,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for considering Aspose.
Please try the following sample code as I tested it and it works fine for setting both Chart Object and its Plot Area. I have also attached the resultant file for your reference:
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook();
workbook.Open(@"d:\test_temp\xl.xls");
Aspose.Cells.Chart chart = workbook.Worksheets[1].Charts[0];
chart.PlotArea.Y = 0;
chart.PlotArea.X = 0;
chart.ChartObject.Left = 0;
chart.ChartObject.Top = 0;
workbook.Save(@"d:\test_temp\outxl2.xls");
Thank You & Best Regards,
Nausherwan,
To explain some more: I want to be able to set an x/y offset from the anchor row/column without it changing the chart.
Hi Shaun,
Thank you for considering Aspose.
We will get back to you soon regarding your issue.
Thank You & Best Regards,
Do you have an update? Appreciate your help as always.
Hi,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Sorry for the delayed response.
Our development team is currently on leave this week due to the Spring Festival Holidays. I will update you regarding your issue early next week.
Thank you for being patient,
Hi,
We are not completely sure about your issue. Please try the attached latest version/fix v4.8.2.6 and let us know if it work fine.
If you still find any issue, kindly create a sample project, zip it and post it here to show the issue with all the details, we will look into it soon.
Thank you.
Amjad,
Hi,
Well, I think the chart.ChartObject.Top/Left works as expected. I use the new fix v4.8.2.6 (that we attached in the previous post in this thread), attached is the output file using your code and template file.
I think you may give less values for chart.ChartObject.Top/Left to place the chart in your desired location in A1 cell.
Please check the attached file, Is it not what you want for your desired result. If not, kindly let us know where the chart should be placed. You should also post your expected file here.
Thank you.
Amjad,
Hi,
Please see the attached image. The first chart is the output if you leave top and left at 0. Note the chart is perfectly drawn.
The second chart in the image is the output when setting top and left both
to 100 pixels. Note the interior of the chart has moved to the right
and now the legend overlaps the plot area.
I am still unable to find any issue here. I have the environment: VS.NET 2005, WinXp, Excel 2007.
Attached are my screen shots, check them, the are fine.
What is your environment, system details, MS Excel version etc.
Thank you.
Amjad,
Addition to my last post: some charts still show up wrong even in Excel 2002.
Hi,
Thanks for providing us further details.
We will further look into it and get back to you soon.
Thank you.
Hi,
We found your mentioned issue in Excel 2007 on Windows Vista. We will figure it out soon.
Your issue has been logged into our issue tracking system with an issue id: CELLSNET-14618.
Thank you.
Hi,
Please try the attached version, we have fixed your mentioned issue.
Thanks.
Looks great, thank you for your quick work.