alwbtc
alwbtc

Reputation: 29445

Cannot add data labels to column chart created by python's xlsxwriter module

I create a column chart with python's xlsxwriter module and I try to add value data labels on top of each column, but the created excel file is empty:

'data_labels': {'value': True, 'position': 'above'}

And I get no exceptions either. When I comment out this line, however, the code runs without errors, the chart is created as expected. Is there a known bug?

Upvotes: 2

Views: 756

Answers (1)

jmcnamara
jmcnamara

Reputation: 41574

The data lable position has to match the available positions supported by the Excel chart type.

For example the above position in line charts is called outside_end for column/bar charts (in Excel).

Check in Excel which is the position you need for the chart type that you have. If you are using a column charts then it should be outside_end.

There is an open issue for this to re-map the names for different chart types.

Upvotes: 2

Related Questions