Aspose::Cells::Charts::DisplayUnitLabel class

DisplayUnitLabel class

Represents the display unit label.

class DisplayUnitLabel : public Aspose::Cells::Charts::ChartTextFrame

Methods

MethodDescription
Characters(int32_t startIndex, int32_t length)Returns a Characters object that represents a range of characters within the text.
ChartFrame(ChartFrame_Impl* impl)Constructs from an implementation object.
ChartFrame(const ChartFrame& src)Copy constructor.
ChartTextFrame(ChartTextFrame_Impl* impl)Constructs from an implementation object.
ChartTextFrame(const ChartTextFrame& src)Copy constructor.
ChartTextFrame(const ChartFrame& src)Constructs from a parent object.
DisplayUnitLabel(DisplayUnitLabel_Impl* impl)Constructs from an implementation object.
DisplayUnitLabel(const DisplayUnitLabel& src)Copy constructor.
DisplayUnitLabel(const ChartTextFrame& src)Constructs from a parent object.
GetArea()Gets the area.
GetAutoScaleFont()True if the text in the object changes font size when the object size changes. The default value is True.
GetBackgroundMode()Gets and sets the display mode of the background.
GetBorder()Gets the border.
GetDefaultHeight()Represents height of default position.
GetDefaultWidth()Represents width of default position.
GetDefaultX()Represents x of default position.
GetDefaultY()Represents y of default position.
GetDirectionType()Gets and sets the direction of text.
GetFont()Gets a Font object of the specified ChartFrame object.
GetHeight()Gets or sets the height of frame in units of 1/4000 of the chart area.
GetLinkedSource()Gets and sets a reference to the worksheet.
GetReadingOrder()Represents text reading order.
GetRotationAngle()Represents text rotation angle.
GetShadow()True if the frame has a shadow.
GetShapeProperties()Gets the ShapeProperties object.
GetText()Gets or sets the text of display unit label.
GetTextHorizontalAlignment()Gets and sets the text horizontal alignment.
GetTextOptions()Gets and sets the options of the text.
GetTextVerticalAlignment()Gets or sets the text vertical alignment of text.
GetWidth()Gets or sets the width of frame in units of 1/4000 of the chart area.
GetX()Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
GetY()Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
IsAutomaticRotation()Indicates whether the text of the chart is automatically rotated.
IsAutomaticSize()Indicates whether the chart frame is automatic sized.
IsAutoText()Indicates the text is auto generated.
IsDefaultPosBeSet()Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
IsDeleted()Indicates whether this data labels is deleted.
IsInnerMode()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.
IsNull() constChecks whether the implementation object is nullptr.
IsResizeShapeToFitText()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.
IsTextWrapped()Gets or sets a value indicating whether the text is wrapped.
explicit operator bool() constoperator bool()
operator=(const DisplayUnitLabel& src)operator=
operator=(const ChartTextFrame& src)operator=
operator=(const ChartFrame& src)operator=
SetAutoScaleFont(bool value)True if the text in the object changes font size when the object size changes. The default value is True.
SetBackgroundMode(BackgroundMode value)Gets and sets the display mode of the background.
SetDirectionType(ChartTextDirectionType value)Gets and sets the direction of text.
SetHeight(int32_t value)Gets or sets the height of frame in units of 1/4000 of the chart area.
SetIsAutomaticSize(bool value)Indicates whether the chart frame is automatic sized.
SetIsAutoText(bool value)Indicates the text is auto generated.
SetIsDeleted(bool value)Indicates whether this data labels is deleted.
SetIsInnerMode(bool value)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.
SetIsResizeShapeToFitText(bool value)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.
SetIsTextWrapped(bool value)Gets or sets a value indicating whether the text is wrapped.
SetLinkedSource(const U16String& value)Gets and sets a reference to the worksheet.
SetLinkedSource(const char16_t* value)Gets and sets a reference to the worksheet.
SetPositionAuto()Set position of the frame to automatic.
SetReadingOrder(TextDirectionType value)Represents text reading order.
SetRotationAngle(int32_t value)Represents text rotation angle.
SetShadow(bool value)True if the frame has a shadow.
SetText(const U16String& value)Gets or sets the text of display unit label.
SetText(const char16_t* value)Gets or sets the text of display unit label.
SetTextHorizontalAlignment(TextAlignmentType value)Gets and sets the text horizontal alignment.
SetTextVerticalAlignment(TextAlignmentType value)Gets or sets the text vertical alignment of text.
SetWidth(int32_t value)Gets or sets the width of frame in units of 1/4000 of the chart area.
SetX(int32_t value)Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
SetY(int32_t value)Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
~ChartFrame()Destructor.
~ChartTextFrame()Destructor.
~DisplayUnitLabel()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;
//Adding a new worksheet to the Excel object
int sheetIndex = workbook.GetWorksheets().Add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.GetWorksheets().Get(sheetIndex);
//Adding a sample value to "A1" cell
worksheet.GetCells().Get(u"A1").PutValue(50);
//Adding a sample value to "A2" cell
worksheet.GetCells().Get(u"A2").PutValue(100);
//Adding a sample value to "A3" cell
worksheet.GetCells().Get(u"A3").PutValue(150);
//Adding a sample value to "A4" cell
worksheet.GetCells().Get(u"A4").PutValue(200);
//Adding a sample value to "B1" cell
worksheet.GetCells().Get(u"B1").PutValue(60);
//Adding a sample value to "B2" cell
worksheet.GetCells().Get(u"B2").PutValue(32);
//Adding a sample value to "B3" cell
worksheet.GetCells().Get(u"B3").PutValue(50);
//Adding a sample value to "B4" cell
worksheet.GetCells().Get(u"B4").PutValue(40);
//Adding a sample value to "C1" cell as category data
worksheet.GetCells().Get(u"C1").PutValue(u"Q1");
//Adding a sample value to "C2" cell as category data
worksheet.GetCells().Get(u"C2").PutValue(u"Q2");
//Adding a sample value to "C3" cell as category data
worksheet.GetCells().Get(u"C3").PutValue(u"Y1");
//Adding a sample value to "C4" cell as category data
worksheet.GetCells().Get(u"C4").PutValue(u"Y2");
//Adding a chart to the worksheet
int chartIndex = worksheet.GetCharts().Add(ChartType::Column, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
Chart chart = worksheet.GetCharts().Get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
chart.GetNSeries().Add(u"A1:B4", true);
//Setting the data source for the category data of NSeries
chart.GetNSeries().SetCategoryData(u"C1:C4");
//Setting the display unit of value(Y) axis.
chart.GetValueAxis().SetDisplayUnit(DisplayUnitType::Hundreds);
DisplayUnitLabel displayUnitLabel = chart.GetValueAxis().GetDisplayUnitLabel();
//Setting the custom display unit label
displayUnitLabel.SetText(u"100");
//Saving the Excel file
workbook.Save(u"book1.xls");

Aspose::Cells::Cleanup();

See Also