DisplayUnitLabel class
DisplayUnitLabel class
Represents the display unit label.
Inheritance: DisplayUnitLabel
→
ChartTextFrame
→
ChartFrame
The DisplayUnitLabel type exposes the following members:
Properties
Property | Description |
---|---|
is_inner_mode | Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels. |
border | Gets the Line . |
area | Gets the ChartFrame.area . |
text_font | Gets a ChartFrame.font object of the specified ChartFrame object. |
text_options | Gets and sets the options of the text. |
font | Gets a DisplayUnitLabel.font object of the specified ChartFrame object. |
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 | Gets and sets the display mode of the background |
background | Gets and sets the display mode of the background |
is_automatic_size | Indicates whether the chart frame is automatic sized. |
x | Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. |
y | Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. |
height | Gets or sets the height of frame in units of 1/4000 of the chart area. |
width | Gets or sets the width of frame in units of 1/4000 of the chart area. |
shadow | True if the frame has a shadow. |
shape_properties | Gets the ChartFrame.shape_properties object. |
is_default_pos_be_set | Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set. |
default_x | Represents x of default position |
default_y | Represents y of default position |
default_width | Represents width of default position |
default_height | Represents height of default position |
is_auto_text | Indicates the text is auto generated. |
is_deleted | Indicates whether this data labels is deleted. |
text_horizontal_alignment | Gets and sets the text horizontal alignment. |
text_vertical_alignment | Gets or sets the text vertical alignment of text. |
rotation_angle | Represents text rotation angle. |
is_automatic_rotation | Indicates whether the text of the chart is automatically rotated. |
text | Gets or sets the text of display unit label. |
linked_source | Gets and sets a reference to the worksheet. |
text_direction | Represents text reading order. |
reading_order | Represents text reading order. |
direction_type | Gets and sets the direction of text. |
is_text_wrapped | Gets or sets a value indicating whether the text is wrapped. |
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 when text within a shape is scaled in order to contain all the text inside. |
Methods
Method | Description |
---|---|
set_position_auto | Set position of the frame to automatic |
characters | Returns a Characters object that represents a range of characters within the text. |
Example
from aspose.cells import Workbook
from aspose.cells.charts import ChartType, DisplayUnitType
# Instantiating a Workbook object
workbook = Workbook()
# Adding a new worksheet to the Excel object
sheetIndex = workbook.worksheets.add()
# Obtaining the reference of the newly added worksheet by passing its sheet index
worksheet = workbook.worksheets[sheetIndex]
# Adding a sample value to "A1" cell
worksheet.cells.get("A1").put_value(50)
# Adding a sample value to "A2" cell
worksheet.cells.get("A2").put_value(100)
# Adding a sample value to "A3" cell
worksheet.cells.get("A3").put_value(150)
# Adding a sample value to "A4" cell
worksheet.cells.get("A4").put_value(200)
# Adding a sample value to "B1" cell
worksheet.cells.get("B1").put_value(60)
# Adding a sample value to "B2" cell
worksheet.cells.get("B2").put_value(32)
# Adding a sample value to "B3" cell
worksheet.cells.get("B3").put_value(50)
# Adding a sample value to "B4" cell
worksheet.cells.get("B4").put_value(40)
# Adding a sample value to "C1" cell as category data
worksheet.cells.get("C1").put_value("Q1")
# Adding a sample value to "C2" cell as category data
worksheet.cells.get("C2").put_value("Q2")
# Adding a sample value to "C3" cell as category data
worksheet.cells.get("C3").put_value("Y1")
# Adding a sample value to "C4" cell as category data
worksheet.cells.get("C4").put_value("Y2")
# Adding a chart to the worksheet
chartIndex = worksheet.charts.add(ChartType.COLUMN, 5, 0, 15, 5)
# Accessing the instance of the newly added chart
chart = worksheet.charts[chartIndex]
# Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
chart.n_series.add("A1:B4", True)
# Setting the data source for the category data of NSeries
chart.n_series.category_data = "C1:C4"
# Setting the display unit of value(Y) axis.
chart.value_axis.display_unit = DisplayUnitType.HUNDREDS
displayUnitLabel = chart.value_axis.display_unit_label
# Setting the custom display unit label
displayUnitLabel.text = "100"
# Saving the Excel file
workbook.save("book1.xls")
See Also
- module
aspose.cells.charts
- class
ChartFrame
- class
ChartTextFrame
- class
DisplayUnitLabel
- class
Line