ChartDataLabelPosition enumeration

ChartDataLabelPosition enumeration

Specifies the position for a chart data label.

Not all series types allow you to specify label positions. And those that do, do not support all values.

Members

NameDescription
CENTERSpecifies that a data label should be displayed centered on a data marker.
LEFTSpecifies that a data label should be displayed to the left of a data marker.
RIGHTSpecifies that a data label should be displayed to the right of a data marker.
ABOVESpecifies that a data label should be displayed above a data marker.
BELOWSpecifies that a data label should be displayed below a data marker.
INSIDE_BASESpecifies that a data label should be displayed inside the base of a data marker.
INSIDE_ENDSpecifies that a data label should be displayed inside the end of a data marker.
OUTSIDE_ENDSpecifies that a data label should be displayed outside the end of a data marker.
BEST_FITSpecifies that a data label should be displayed in the most appropriate position.

Examples

Shows how to set the position of the data label.

doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
# Insert column chart.
shape = builder.insert_chart(chart_type=aw.drawing.charts.ChartType.COLUMN, width=432, height=252)
chart = shape.chart
series_coll = chart.series
# Delete default generated series.
series_coll.clear()
# Add series.
series = series_coll.add(series_name='Series 1', categories=['Category 1', 'Category 2', 'Category 3'], values=[4, 5, 6])
# Show data labels and set font color.
series.has_data_labels = True
data_labels = series.data_labels
data_labels.show_value = True
data_labels.font.color = aspose.pydrawing.Color.white
# Set data label position.
data_labels.position = aw.drawing.charts.ChartDataLabelPosition.INSIDE_BASE
data_labels[0].position = aw.drawing.charts.ChartDataLabelPosition.OUTSIDE_END
data_labels[0].font.color = aspose.pydrawing.Color.dark_red
doc.save(file_name=ARTIFACTS_DIR + 'Charts.LabelPosition.docx')

See Also