
## DataLabels class

Encapsulates a collection of all the DataLabel objects for the specified Series.



**Inheritance:** [`DataLabels`](/cells/python-net/aspose.cells.charts/datalabels) → 
[`ChartTextFrame`](/cells/python-net/aspose.cells.charts/charttextframe) → 
[`ChartFrame`](/cells/python-net/aspose.cells.charts/chartframe)



The DataLabels type exposes the following members:

### Properties
| Property | Description |
| :- | :- |
| [is_inner_mode](/cells/python-net/aspose.cells.charts/datalabels/is_inner_mode) | Indicates whether the size of the plot area size includes the tick marks, and the axis labels.<br/>False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels. |
| [border](/cells/python-net/aspose.cells.charts/datalabels/border) | Gets the [`Line`](/cells/python-net/aspose.cells.drawing/line). |
| [area](/cells/python-net/aspose.cells.charts/datalabels/area) | Gets the [`DataLabels.area`](/cells/python-net/aspose.cells.charts/datalabels#area). |
| [text_font](/cells/python-net/aspose.cells.charts/datalabels/text_font) | Gets a [`ChartFrame.font`](/cells/python-net/aspose.cells.charts/chartframe#font) object of the specified ChartFrame object. |
| [text_options](/cells/python-net/aspose.cells.charts/datalabels/text_options) | Gets and sets the options of the text. |
| [font](/cells/python-net/aspose.cells.charts/datalabels/font) | Gets the font of the DataLabels; |
| [auto_scale_font](/cells/python-net/aspose.cells.charts/datalabels/auto_scale_font) | True if the text in the object changes font size when the object size changes. The default value is True. |
| [background_mode](/cells/python-net/aspose.cells.charts/datalabels/background_mode) | Gets and sets the display mode of the background |
| [background](/cells/python-net/aspose.cells.charts/datalabels/background) | Gets and sets the display mode of the background |
| [is_automatic_size](/cells/python-net/aspose.cells.charts/datalabels/is_automatic_size) | Indicates whether the chart frame is automatic sized. |
| [x](/cells/python-net/aspose.cells.charts/datalabels/x) | Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. |
| [y](/cells/python-net/aspose.cells.charts/datalabels/y) | Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. |
| [height](/cells/python-net/aspose.cells.charts/datalabels/height) | Gets or sets the height of frame in units of 1/4000 of the chart area. |
| [width](/cells/python-net/aspose.cells.charts/datalabels/width) | Gets or sets the width of frame in units of 1/4000 of the chart area. |
| [shadow](/cells/python-net/aspose.cells.charts/datalabels/shadow) | True if the frame has a shadow. |
| [shape_properties](/cells/python-net/aspose.cells.charts/datalabels/shape_properties) | Gets the [`ChartFrame.shape_properties`](/cells/python-net/aspose.cells.charts/chartframe#shape_properties) object. |
| [is_default_pos_be_set](/cells/python-net/aspose.cells.charts/datalabels/is_default_pos_be_set) | Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set. |
| [default_x](/cells/python-net/aspose.cells.charts/datalabels/default_x) | Represents x of default position in units of 1/4000 of the chart area. |
| [default_y](/cells/python-net/aspose.cells.charts/datalabels/default_y) | Represents y of default position in units of 1/4000 of the chart area. |
| [default_width](/cells/python-net/aspose.cells.charts/datalabels/default_width) | Represents width of default position in units of 1/4000 of the chart area. |
| [default_height](/cells/python-net/aspose.cells.charts/datalabels/default_height) | Represents height of default position in units of 1/4000 of the chart area. |
| [default_x_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/default_x_ratio_to_chart) | Represents x of default position in units of Fraction of the chart area. |
| [default_y_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/default_y_ratio_to_chart) | Represents y of default position in units of Fraction of the chart area. |
| [default_width_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/default_width_ratio_to_chart) | Represents width of default position in units of Fraction of the chart area. |
| [default_height_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/default_height_ratio_to_chart) | Represents height of default position in units of Fraction of the chart area. |
| [x_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/x_ratio_to_chart) | Gets or sets the x coordinate of the upper left corner in units of ratio of the chart area. |
| [y_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/y_ratio_to_chart) | Gets or sets the y coordinate of the upper left corner in units of ratio of the chart area. |
| [width_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/width_ratio_to_chart) | Gets or sets the width of frame in units of ratio of the chart area. |
| [height_ratio_to_chart](/cells/python-net/aspose.cells.charts/datalabels/height_ratio_to_chart) | Gets or sets the height of frame in units of ratio of the chart area. |
| [x_pixel](/cells/python-net/aspose.cells.charts/datalabels/x_pixel) | Gets or sets the x coordinate of the upper left corner in units of Pixel. |
| [y_pixel](/cells/python-net/aspose.cells.charts/datalabels/y_pixel) | Gets or sets the y coordinate of the upper left corner in units of Pixel. |
| [width_pixel](/cells/python-net/aspose.cells.charts/datalabels/width_pixel) | Gets or sets the width of frame in units of Pixel. |
| [height_pixel](/cells/python-net/aspose.cells.charts/datalabels/height_pixel) | Gets or sets the height of frame in units of Pixel. |
| [is_auto_text](/cells/python-net/aspose.cells.charts/datalabels/is_auto_text) | Indicates the text is auto generated. |
| [is_deleted](/cells/python-net/aspose.cells.charts/datalabels/is_deleted) | Indicates whether this data labels is deleted. |
| [text_horizontal_alignment](/cells/python-net/aspose.cells.charts/datalabels/text_horizontal_alignment) | Gets and sets the text horizontal alignment. |
| [text_vertical_alignment](/cells/python-net/aspose.cells.charts/datalabels/text_vertical_alignment) | Gets or sets the text vertical alignment of text. |
| [rotation_angle](/cells/python-net/aspose.cells.charts/datalabels/rotation_angle) | Represents text rotation angle. |
| [is_automatic_rotation](/cells/python-net/aspose.cells.charts/datalabels/is_automatic_rotation) | Indicates whether the text of the chart is automatically rotated. |
| [text](/cells/python-net/aspose.cells.charts/datalabels/text) | Gets or sets the text of data label. |
| [linked_source](/cells/python-net/aspose.cells.charts/datalabels/linked_source) | Gets and sets a reference to the worksheet. |
| [text_direction](/cells/python-net/aspose.cells.charts/datalabels/text_direction) | Represents text reading order. |
| [reading_order](/cells/python-net/aspose.cells.charts/datalabels/reading_order) | Represents text reading order. |
| [direction_type](/cells/python-net/aspose.cells.charts/datalabels/direction_type) | Gets and sets the direction of text. |
| [is_text_wrapped](/cells/python-net/aspose.cells.charts/datalabels/is_text_wrapped) | Gets or sets a value indicating whether the text is wrapped. |
| [is_resize_shape_to_fit_text](/cells/python-net/aspose.cells.charts/datalabels/is_resize_shape_to_fit_text) | Gets or sets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is<br/>when text within a shape is scaled in order to contain all the text inside. |
| [show_value](/cells/python-net/aspose.cells.charts/datalabels/show_value) | Represents a specified chart's data label values display behavior. True displays the values. False to hide. |
| [show_cell_range](/cells/python-net/aspose.cells.charts/datalabels/show_cell_range) | Indicates whether showing cell range as the data labels. |
| [show_percentage](/cells/python-net/aspose.cells.charts/datalabels/show_percentage) | Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide. |
| [show_bubble_size](/cells/python-net/aspose.cells.charts/datalabels/show_bubble_size) | Represents a specified chart's data label percentage value display behavior. True displays the percentage value. False to hide. |
| [show_category_name](/cells/python-net/aspose.cells.charts/datalabels/show_category_name) | Represents a specified chart's data label category name display behavior.True to display the category name for the data labels on a chart. False to hide. |
| [show_series_name](/cells/python-net/aspose.cells.charts/datalabels/show_series_name) | Indicates whether the series name displays for the data labels on a chart.<br/>True to show the series name. False to hide. |
| [show_legend_key](/cells/python-net/aspose.cells.charts/datalabels/show_legend_key) | Represents a specified chart's data label legend key display behavior.<br/>True if the data label legend key is visible. |
| [number_format](/cells/python-net/aspose.cells.charts/datalabels/number_format) | Represents the format string for the DataLabels object. |
| [number](/cells/python-net/aspose.cells.charts/datalabels/number) | Gets and sets the built-in number format. |
| [number_format_linked](/cells/python-net/aspose.cells.charts/datalabels/number_format_linked) | True if the number format is linked to the cells <br/>(so that the number format changes in the labels when it changes in the cells). |
| [separator_type](/cells/python-net/aspose.cells.charts/datalabels/separator_type) | Gets or sets the separator type used for the data labels on a chart. |
| [separator_value](/cells/python-net/aspose.cells.charts/datalabels/separator_value) | Gets or sets the separator value used for the data labels on a chart. |
| [position](/cells/python-net/aspose.cells.charts/datalabels/position) | Represents the position of the data label. |
| [is_never_overlap](/cells/python-net/aspose.cells.charts/datalabels/is_never_overlap) | Indicates whether the datalabels display never overlap. (For Pie chart) |
| [shape_type](/cells/python-net/aspose.cells.charts/datalabels/shape_type) | Gets or sets  shape type of data label. |


### Methods
| Method | Description |
| :- | :- |
| [`set_position_auto(self)`](/cells/python-net/aspose.cells.charts/datalabels/set_position_auto/#) | Set position of the frame to automatic |
| [`characters(self, start_index, length)`](/cells/python-net/aspose.cells.charts/datalabels/characters/#int-int) | Returns a Characters object that represents a range of characters within the text. |
| [`apply_font(self)`](/cells/python-net/aspose.cells.charts/datalabels/apply_font/#) | Apply the font of the datalabels to all child nodes. |



### Example 


```python
from aspose.cells import Workbook
from aspose.cells.charts import LabelPositionType

# Set the DataLabels in the chart
wb = Workbook("chart.xlsx")
chart = wb.worksheets[0].charts[0]
for i in range(len(chart.n_series)):
    datalabels = chart.n_series[i].data_labels
    # Set the position of DataLabels
    datalabels.position = LabelPositionType.INSIDE_BASE
    # Show the category name in the DataLabels
    datalabels.show_category_name = True
    # Show the value in the DataLabels
    datalabels.show_value = True
    # Not show the percentage in the DataLabels
    datalabels.show_percentage = False
    # Not show the legend key.
    datalabels.show_legend_key = False

```

### See Also
* module [`aspose.cells.charts`](..)
* class [`ChartFrame`](/cells/python-net/aspose.cells.charts/chartframe)
* class [`ChartTextFrame`](/cells/python-net/aspose.cells.charts/charttextframe)
* class [`DataLabels`](/cells/python-net/aspose.cells.charts/datalabels)
* class [`Line`](/cells/python-net/aspose.cells.drawing/line)
