Reputation: 23
I can't find example how to set the vertical orientation of a text in text box
I find how to rotate text in cell, but I need rotate text in text box
text box code
text = 'Some text in a textbox'
options = {
'font': {'color': 'white'},
'align': {'vertical': 'middle',
'horizontal': 'center',
},
'gradient': {'colors': ['red', 'blue']},
}
worksheet.insert_textbox(row, col, text, options)
code with rotation text in cell
cell_format = workbook.add_format()
cell_format.set_rotation(90)
worksheet.write(1, 1, 'This text is rotated')
worksheet.set_column(col, col, None, cell_format)
Upvotes: 2
Views: 313
Reputation: 41574
That isn't a currently available feature but if you open a Feature Request on GitHub I can add it.
Update: This is now available in XlsxWriter >= 1.2.4.
From the updated docs:
The text_rotation option can be used to set the text rotation for the entire textbox:
worksheet.insert_textbox('B2', 'Text rotated up',
{'text_rotation': 90})
Upvotes: 1