Reputation: 718
I have just discovered the website for the Python API : XlsxWriter. I am specifically looking at the Chart creation aspect. I found an example with Date type on the x-axis and in the example the dates are oriented 45 deg with respect to the horizontal: http://xlsxwriter.readthedocs.org/example_chart_date_axis.html
But, when I look at the code below it, I do not see reference to how to control the angle. For example if I wanted the dates oriented at 30 degrees instead.
Is there a function or method that controls the orientation such that a programmer can specify the desired angle?
I found this article on Stack Overflow: Modify chart label orientation with XlsxWriter module (Python). The developer mentions "Chart axis font orientation", but I am not sure if this is what controls the date labels on the x-axis.
Upvotes: 4
Views: 3223
Reputation: 41644
I do not see reference to how to control the angle. For example if I wanted the dates oriented at 30 degrees instead.
Excel rotates date values automatically when necessary (which is the case in the example that you linked to).
However, you can control the rotation yourself as a font property (like in Excel):
chart.set_x_axis({'num_font': {'rotation': 45}})
See the Chart Fonts section of the docs.
Upvotes: 9