mongotop mongotop - 5 months ago 8
Python Question

How to rotate the data_label values on column chart

Trying to rotate the

data_label
values on the chart to 90 degree since my chart is condensed and the values and overlapping.

I tried this but its not working, maybe because
'num_font': {'rotation': 90}
is only for
set_x_axis
.

'data_labels': { 'value': True, 'position' : 'outside_end', 'num_font': {'rotation': 90} }

Answer

The font data label property can be used to rotate the data labels in a series:

 chart.add_series({
     'values': '=Sheet1!$A$1:$A$5',
     'data_labels': {
         'value': True,
         'font': {'rotation': 45}
     },
 })
Comments