Class DisplayUnitLabel
Contents
[
Hide
]DisplayUnitLabel class
Represents the display unit label.
public class DisplayUnitLabel : ChartTextFrame
Properties
Name | Description |
---|---|
virtual Area { get; } | Gets the area .(Inherited from ChartFrame .) |
override AutoScaleFont { get; set; } | True if the text in the object changes font size when the object size changes. The default value is True. |
Background { get; set; } | (Obsolete.) Gets and sets the display mode of the background(Inherited from ChartFrame .) |
BackgroundMode { get; set; } | Gets and sets the display mode of the background(Inherited from ChartFrame .) |
virtual Border { get; } | Gets the border .(Inherited from ChartFrame .) |
DefaultHeight { get; } | Represents height of default position(Inherited from ChartFrame .) |
DefaultWidth { get; } | Represents width of default position(Inherited from ChartFrame .) |
DefaultX { get; } | Represents x of default position(Inherited from ChartFrame .) |
DefaultY { get; } | Represents y of default position(Inherited from ChartFrame .) |
virtual DirectionType { get; set; } | Gets and sets the direction of text.(Inherited from ChartTextFrame .) |
override Font { get; } | Gets a Font object of the specified ChartFrame object. |
virtual Height { get; set; } | Gets or sets the height of frame in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
IsAutomaticRotation { get; } | Indicates whether the text of the chart is automatically rotated.(Inherited from ChartTextFrame .) |
virtual IsAutomaticSize { get; set; } | Indicates whether the chart frame is automatic sized.(Inherited from ChartFrame .) |
virtual IsAutoText { get; set; } | Indicates the text is auto generated.(Inherited from ChartTextFrame .) |
IsDefaultPosBeSet { get; } | Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.(Inherited from ChartFrame .) |
IsDeleted { get; set; } | Indicates whether this data labels is deleted.(Inherited from ChartTextFrame .) |
IsInnerMode { get; set; } | 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.(Inherited from ChartFrame .) |
IsResizeShapeToFitText { get; set; } | 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.(Inherited from ChartTextFrame .) |
virtual IsTextWrapped { get; set; } | Gets or sets a value indicating whether the text is wrapped.(Inherited from ChartTextFrame .) |
virtual LinkedSource { get; set; } | Gets and sets a reference to the worksheet.(Inherited from ChartTextFrame .) |
ReadingOrder { get; set; } | Represents text reading order.(Inherited from ChartTextFrame .) |
RotationAngle { get; set; } | Represents text rotation angle.(Inherited from ChartTextFrame .) |
Shadow { get; set; } | True if the frame has a shadow.(Inherited from ChartFrame .) |
ShapeProperties { get; } | Gets the ShapeProperties object.(Inherited from ChartFrame .) |
override Text { get; set; } | Gets or sets the text of display unit label. |
TextDirection { get; set; } | (Obsolete.) Represents text reading order.(Inherited from ChartTextFrame .) |
virtual TextFont { get; } | (Obsolete.) Gets a Font object of the specified ChartFrame object.(Inherited from ChartFrame .) |
TextHorizontalAlignment { get; set; } | Gets and sets the text horizontal alignment.(Inherited from ChartTextFrame .) |
virtual TextOptions { get; } | Gets and sets the options of the text.(Inherited from ChartFrame .) |
TextVerticalAlignment { get; set; } | Gets or sets the text vertical alignment of text.(Inherited from ChartTextFrame .) |
virtual Width { get; set; } | Gets or sets the width of frame in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
virtual X { get; set; } | Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
virtual Y { get; set; } | Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
Methods
Name | Description |
---|---|
Characters(int, int) | Returns a Characters object that represents a range of characters within the text.(Inherited from ChartTextFrame .) |
virtual SetPositionAuto() | Set position of the frame to automatic(Inherited from ChartFrame .) |
Examples
[C#]
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Excel object
int sheetIndex = workbook.Worksheets.Add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[sheetIndex];
//Adding a sample value to "A1" cell
worksheet.Cells["A1"].PutValue(50);
//Adding a sample value to "A2" cell
worksheet.Cells["A2"].PutValue(100);
//Adding a sample value to "A3" cell
worksheet.Cells["A3"].PutValue(150);
//Adding a sample value to "A4" cell
worksheet.Cells["A4"].PutValue(200);
//Adding a sample value to "B1" cell
worksheet.Cells["B1"].PutValue(60);
//Adding a sample value to "B2" cell
worksheet.Cells["B2"].PutValue(32);
//Adding a sample value to "B3" cell
worksheet.Cells["B3"].PutValue(50);
//Adding a sample value to "B4" cell
worksheet.Cells["B4"].PutValue(40);
//Adding a sample value to "C1" cell as category data
worksheet.Cells["C1"].PutValue("Q1");
//Adding a sample value to "C2" cell as category data
worksheet.Cells["C2"].PutValue("Q2");
//Adding a sample value to "C3" cell as category data
worksheet.Cells["C3"].PutValue("Y1");
//Adding a sample value to "C4" cell as category data
worksheet.Cells["C4"].PutValue("Y2");
//Adding a chart to the worksheet
int chartIndex = worksheet.Charts.Add(ChartType.Column, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
Chart chart = worksheet.Charts[chartIndex];
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
chart.NSeries.Add("A1:B4", true);
//Setting the data source for the category data of NSeries
chart.NSeries.CategoryData = "C1:C4";
//Setting the display unit of value(Y) axis.
chart.ValueAxis.DisplayUnit = DisplayUnitType.Hundreds;
DisplayUnitLabel displayUnitLabel = chart.ValueAxis.DisplayUnitLabel;
//Setting the custom display unit label
displayUnitLabel.Text = "100";
//Saving the Excel file
workbook.Save("book1.xls");
[Visual Basic]
'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()
'Adding a new worksheet to the Excel object
Dim sheetIndex As Int32 = workbook.Worksheets.Add()
'Obtaining the reference of the newly added worksheet by passing its sheet index
Dim worksheet As Worksheet = workbook.Worksheets(sheetIndex)
'Adding a sample value to "A1" cell
worksheet.Cells("A1").PutValue(50)
'Adding a sample value to "A2" cell
worksheet.Cells("A2").PutValue(100)
'Adding a sample value to "A3" cell
worksheet.Cells("A3").PutValue(150)
'Adding a sample value to "A4" cell
worksheet.Cells("A4").PutValue(200)
'Adding a sample value to "B1" cell
worksheet.Cells("B1").PutValue(60)
'Adding a sample value to "B2" cell
worksheet.Cells("B2").PutValue(32)
'Adding a sample value to "B3" cell
worksheet.Cells("B3").PutValue(50)
'Adding a sample value to "B4" cell
worksheet.Cells("B4").PutValue(40)
'Adding a sample value to "C1" cell as category data
worksheet.Cells("C1").PutValue("Q1")
'Adding a sample value to "C2" cell as category data
worksheet.Cells("C2").PutValue("Q2")
'Adding a sample value to "C3" cell as category data
worksheet.Cells("C3").PutValue("Y1")
'Adding a sample value to "C4" cell as category data
worksheet.Cells("C4").PutValue("Y2")
'Adding a chart to the worksheet
Dim chartIndex As Int32 = worksheet.Charts.Add(ChartType.Column, 5, 0, 15, 5)
'Accessing the instance of the newly added chart
Dim chart As Chart = worksheet.Charts(chartIndex)
'Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
chart.NSeries.Add("A1:B4", True)
'Setting the data source for the category data of NSeries
Chart.NSeries.CategoryData = "C1:C4"
'Setting the display unit of value(Y) axis.
chart.ValueAxis.DisplayUnit = DisplayUnitType.Hundreds
Dim displayUnitLabel As DisplayUnitLabel = chart.ValueAxis.DisplayUnitLabel
'Setting the custom display unit label
displayUnitLabel.Text = "100"
'Saving the Excel file
workbook.Save("book1.xls")
See Also
- class ChartTextFrame
- namespace Aspose.Cells.Charts
- assembly Aspose.Cells