Xlsxwriter custom data labels

I am creating a rather complex graph using xlsxwriter and I need data labels that are different from the data values ​​viewed in the documentation, I see that I can add data labels as follows.

chart2.add_series({ 'name': '=Sheet1!$J$1', 'categories': '=Sheet1!$A$2:$A$22', 'values': '=Sheet1!$J$2:$J$22', 'data_labels': {values: True} }) 

The problem is that the data labels for my graph must be different from the values, I need to point to another part of the sheet to get my labels:

 'data_labels': 'values_from_cells'=Sheet1!$K$2:$K$22 

in Excel it is very easy to do, 1. right-click on the graph,

  1. mouse click format data labels

  2. contains: values ​​from cells

  3. Then I select the cells that I want and creates data labels

is xlsxwriter function?

+5
source share

Source: https://habr.com/ru/post/1238319/


All Articles