rotation property
ChartTitle.rotation property
Gets or sets the rotation of the chart title in degrees.
@property
def rotation(self) -> int:
...
@rotation.setter
def rotation(self, value: int):
...
Remarks
The range of acceptable values is from -180 to 180 inclusive. The default value is 0.
Examples
Shows how to set orientation and rotation of chart and axis titles.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
chart_shape = builder.insert_chart(chart_type=aw.drawing.charts.ChartType.COLUMN, width=400, height=300)
chart = chart_shape.chart
chart.title.text = 'Sample Chart'
chart.title.orientation = aw.drawing.ShapeTextOrientation.HORIZONTAL
chart.title.rotation = 90
# Before setting title properties, make sure that this title will be displayed.
chart.axis_x.title.show = True
chart.axis_x.title.text = 'X Axis'
chart.axis_x.title.orientation = aw.drawing.ShapeTextOrientation.HORIZONTAL
chart.axis_x.title.rotation = -90
doc.save(file_name=ARTIFACTS_DIR + 'Charts.TitleOrientation.docx')
See Also
- module aspose.words.drawing.charts
- class ChartTitle