New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed charts from xlsx files #65
Conversation
…le failure when spreadsheet has no charts.
Hi Andy, this looks very interesting, thanks for reaching out :). Couple things to start off: First, for various reasons, fairly extensive retirement of learning-curve-related technical debt over the past few months perhaps primary among them, the develop branch is ahead of master by 430-odd commits. So there would be some serious merging to do to incorporate this. Before we think about what that might look like, can you explain for me what the particular user scenario is for this? Like maybe: "I have a bunch of charts I've developed in Excel and I want to add one or more of them into a presentation." or that sort of thing. And an idea of how it would be done from the PowerPoint UI would be very helpful as well, just so I see what procedure is being automated. I'm definitely interested in the package having a general-purpose capability to add charts. It's actually crept up the backlog to where I was thinking to take it on in the first half of next year. I don't think this is that functionality exactly, but I'd like to understand better how it fits in with that. One of the challenges inherent in a start-from-scratch capability is having to build an Excel spreadsheet to embed to hold the data, and it looks like your work involves a way of doing that from an externally-built worksheet, so that could be an interesting incremental step that could be built upon for additional features. If you'll let me know a bit more about what it does and how you've used it we can take things from there :) |
The scenario for which I wrote this was quite simple: we needed to be able The actual approach was determined from the specs and experimentation with
The first two obviously fail at being editable, so I looked into the latter “For WordprocessingML and PresentationML documents, the data for a chart is If we wanted to use a DrawingML chart, it had to embed a spreadsheet. Now another part of our project required us to also generate Excel In summary, what add_chart_from_spreadsheet does is:
This is the default format that Powerpoint uses. When you “Insert Chart”, I’ve been vaguely aware of all the restructuring you’d been doing, but not Andy. On Mon, Dec 9, 2013 at 10:30 AM, scanny notifications@github.com wrote:
|
Thanks Andy, that makes sense of it for me :) I'll have a closer look over the weekend and see how to fit things together. |
I'm very interested in this feature. Is there any update ? |
@tooh Hi Peter, no plans to work on this in the near future. It's a bit of a big nut and there are a lot of other items on the backlog. I kind of vaguely expect to get around to charts in about a year given the current backlog and velocity. Sorry I didn't have better news :) |
Charting capability was added in v0.5.0, pushed today. All the basics are there and its quite functional. The relevant docs pages are here. Special thanks to you Andy @adurdin, I used your code for the initial spike and using it was able to get something working in a single working session. There were about 100 commits between then and now to get all the details ironed out, but it was a big confidence builder at the critical moment as I was getting started to be able to see a chart show up in PowerPoint so soon after I began :) |
This code adds the ability to embed a chart from an Excel spreadsheet into a presentation. The first chart in the spreadsheet is used, and the spreadsheet itself is also embedded so that that chart remains fully editable.
Example usage:
Multiple charts may be added to a presentation, but each must be embedded independently. This is due to limitations (AFAICT imposed by Powerpoint and not by ISO/IEC 29500) that prevent multiple chart shapes referencing a single embedded chart, or multiple embedded charts referencing a single embedded spreadsheet. The latter is possible with linked spreadsheets, but is not implemented in this code.