Trendline trendlineTypes causing chart to not build

Issue #761 resolved
created an issue

Of the list {‘exp’, ‘poly’, ‘linear’, ‘log’, ‘movingAvg’, ‘power’} 'poly' and 'movingAvg' are causing the chart to not be built.

Quick script is attached

Comments (7)

  1. CharlieC

    What do you mean by "does not build"?

    It's worth noting that some chart behaviour is not defined accurately by the OOXML specification. openpyxl is a file format library and orientates itself on the specification. It may be that additional parameters must be passed in for things to work and this looks to be the case for polynomial and moving average trendlines. In this case the best approach is the look at the source of a relevant chart to see what the parameters are so that you can add them. In the case of a polynomial the order must also be supplied: c1.series[0].trendline.order = 2

  2. jjbeanz reporter

    Charlie, thanks for the reply. That makes a lot of sense. Could you point me to a way to view the source of a relevant chart for future reference.

  3. CharlieC

    unzip -d secondary secondary.xlsx Feel free to submit improvements to the documentation: it is necessarily incomplete when it comes to charts because there are so many possibilities.

  4. Log in to comment