-1

I am trying to automate some reports using python-docx.

For now, I am using matplotlib to draw the graphs and save them as .jpg, before adding them to the document. But I would like to have the ability to edit the charts from inside the Word document(see image below).

From what I've read from the documentation, it seems that this feature is not officially supported by python-docx yet. Any suggestions for workarounds?

Edit data

benkyou
  • 61
  • 5

1 Answers1

-1

I found a workaround for this niche case. See this pull request.

benkyou
  • 61
  • 5
  • What workaround? An answer that does nothing but link to something else that may not even exist next week, without even an explanation, isn't helping anyone – Panagiotis Kanavos Aug 30 '23 at 08:24
  • The pull request includes examples on how you can use it to include the MS chart in your document. – benkyou Aug 30 '23 at 08:27
  • This answer doesn't though, which means it's not a good answer and won't be useful to anyone trying to add charts to a Word document. Read [How to write a good answer](https://stackoverflow.com/help/how-to-answer) especially `Provide Context for Links`. The code in the pull request shows manually adding the DOCX parts that constitute a chart, almost as if you were working with the OpenXML SDK directly. – Panagiotis Kanavos Aug 30 '23 at 08:43