If i have an excelworkbook (.xlsx) containg a chart formatted with a theme, and i copy the chart to another workbook using Copy function on the Worksheet. If i then save the workbook and look at the result in Excel the chart copied has the correct theme, however if i use the ToImage function on the copied chart, it shows the default colors (blue/purple), if i do the same (ToImage) on the original chart it shows the themed chart.
I am presuming i am missing some settings or something else that needs to be copied, but can't find what, can someone please help?
Could you try our latest version/fix: v126.96.36.199. If you still find the issue, kindly do paste your runnable sample code with your template files, we will check your issue soon. Also, attach your output image generated by Aspose.Cells API.
We are working on the issue, it is not fixed yet. If the issue is not very complex, it should be fixed within a few days e.g (before the end of this week or so). If it is complex, it might take some time. Anyways, if this is complex issue, we will let you know the eta for it here.
There is no single API to copy formatting or setting to the charts. You may get formatting, settings and data of the chart and its objects from one workbook and apply to other chart in other workbook yourselves via relevant lines of code.
for i in range(0,wscount):
chartsheet = worksheets.get(i).getCharts().getCount()
if (chartsheet > 0):
for j in range(0, chartsheet):
chart = worksheets.get(i).getCharts().get(j)
wb.save("saving file location")
wb.save(“saving output file location”)
In above code, first i am checking if charts is present or not on excel sheet if chart is present then we are removing border of that chart and saving that excel file. But when i am removing border and saving that file then it changing some format of chart or sometime it removing chart title or sometime just changing formatting of title.