Convert excel chart to OOXML

@Adhirath
Do you only want to export a chart to flatopc?
If yes, we can copy chart to an empty workbook, then convert it to flatopc as the following :

 Workbook workbook = new Workbook(dir + "Book1.xlsx");
 Chart chart = workbook.Worksheets[0].Charts[0];
 Workbook w = new Workbook();
 w.Worksheets[0].Shapes.AddCopy(chart.ChartObject, 0, 0, 0, 0);
          
 DocxSaveOptions saveOptions = new DocxSaveOptions();
 saveOptions.AsFlatOpc = true;
 saveOptions.SaveAsEditableShapes = true;
 saveOptions.EmbedXlsxAsChartDataSource = false;

 w.Save(dir + "word_flatopc.xml", saveOptions);

word_flatopc.zip (9.0 KB)

Yes I do want only the chart to export to flapOpc, but even this flatOpc you provided has table tags. What happens because of that is when I insert this xml I get the table design and layout options along with chart design which I would like to avoid. I believe whenever the SaveAsEditableShapes is enabled the table will be present in the OOXML. So the only way I have been able to avoid that is after saving it to Docx I copy only the chart into a new doc and then save that as flatOpc. If we can replicate this great, otherwise I am absolutely fine with just having EmbedXlsxAsChartDataSource saveoption. Hope this makes sense.

@Adhirath
Thank you for your feedback. We have understood your needs. You need to directly convert the chart to flapOpc, and there are no table tags in the conversion result file.

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

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

@Adhirath

Workbook workbook = new Workbook(dir + "Book1.xlsx");
//Chart chart = workbook.Worksheets[1].Charts[0];
//Workbook w = new Workbook();
//w.Worksheets[0].Shapes.AddCopy(chart.ChartObject, 0, 0, 0, 0);

DocxSaveOptions saveOptions = new DocxSaveOptions();
saveOptions.AsFlatOpc = true;
saveOptions.SaveAsEditableShapes = true;
//saveOptions.EmbedXlsxAsChartDataSource = false;
saveOptions.SaveElementType = SaveElementType.Chart;
workbook.Save(dir + "OnlyChart.xml", saveOptions);

Please the attached flatopc file
OnlyChart.zip (15.2 KB)

There is no <tbl> node now.

looks good. Thanks guys really appreciate the effort!

@Adhirath,

Thanks for your feedback.

This new enhancement/fix will be included in the next release (Aspose.Cells v25.9), which will be released before the end of this week of September 2025. We will notify you once the new version is available.

1 Like

Hi guys any update on when the new version will be out?

@Adhirath
We will release the new version v25.9 this week. We will notify you promptly once version v25.9 is released.

sure, any date I can look forward to? Have a dependency on this update.

@Adhirath
Thank you for your feedback. The new version v25.9 will be released before September 12, 2025.

1 Like