Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Excel 2013 chart style #192
Thank you for the detailed report.
It should be 48 in the code. That is a bug which I'll fix.
They are in Excel 2007:
However, in the Excel 2013 User Interface they seem to have been replaced with something that was called "Chart Layouts" in Excel 2007.
Styles (in Excel 2007) are just an index that give one of the choices in the image above. Layouts (in Excel 2007 and "Styles" in Excel 2013) are a collection of modifications made to the chart. They are the same as if someone made 5-20 adjustments to the chart.
The only way to get the Excel 2013 styles is to modify the base chart using the XlsxWriter Chart API. There is no way for the module to specify an index that will give these.
XlsxWriter cannot support Excel 2013 styles since they are a collection of modifications to the base chart. It would take too much work to implement these for all chart types. Also some of the formatting would need extensions for the Excel 2013 file format.
So in summary you will have to modify an existing chart style via the API to get the type of layout that you want or continue to use the macro workaround.
added a commit
Dec 11, 2014
Thanks for quick reply.
I realize that when I modified the chart in Excel and saved it, it made changes into chart.xml inside .xlsx file. So If we know which part inside the chart.xml is corresponding to Excel 2013 styles, we can make these styles available in XlsxWriter by just copying some xml code with ease.
If we can do this, it will also be able to import user-defined styles too.
I just thought.
I examined the changes in the file format as well and I don't think it works like that. It isn't adding a single XML style element or even a nested XML element. It is adding a range of different changes that correspond to different parts of the API.
Try setting 2 different Excel 2013 styles and diffing the resulting files. You will see that there isn't an easy way to replicate the styles.
So this can't/won't be supported in XlsxWriter. Sorry.
However, as I said above the Excel 2013 styles/layouts are just a collection of modifications. You should be able to replicate them via the standard XlsxWriter API. It will take a bit of work but it should be doable.
It would appear that the 48 styles that
Also, kudos on the awesome module. I came from R looking for something that can create native Excel plots, and the functionality of XlsxWriter is simply amazing.