Aspose::Cells::Charts::Title class

Title class

Encapsulates the object that represents the title of chart or axis.

class Title : public Aspose::Cells::Charts::ChartTextFrame

Methods

MethodDescription
Characters()Gets rich text formatting of this Title.
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.
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.
GetOverLay()Represents overlay centered title on chart without resizing chart.
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.
IsVisible()Represents whether the title is visible.
explicit operator bool() constoperator bool()
operator=(const Title& 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.
SetIsVisible(bool value)Represents whether the title is visible.
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.
SetOverLay(bool value)Represents overlay centered title on chart without resizing chart.
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.
Title(Title_Impl* impl)Constructs from an implementation object.
Title(const Title& src)Copy constructor.
Title(const ChartTextFrame& src)Constructs from a parent object.
~ChartFrame()Destructor.
~ChartTextFrame()Destructor.
~Title()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
Workbook workbook;
Worksheet sheet = workbook.GetWorksheets().Get(0);

Cells cells = sheet.GetCells();
cells.Get(0, 1).PutValue(u"Income");
cells.Get(1, 0).PutValue(u"Company A");
cells.Get(2, 0).PutValue(u"Company B");
cells.Get(3, 0).PutValue(u"Company C");
cells.Get(1, 1).PutValue(10000);
cells.Get(2, 1).PutValue(20000);
cells.Get(3, 1).PutValue(30000);

int chartIndex = sheet.GetCharts().Add(ChartType::Column, 9, 9, 21, 15);
Chart chart = sheet.GetCharts().Get(chartIndex);

//Setting the title of a chart
chart.GetTitle().SetText(u"Title");
//Setting the font color of the chart title to blue
chart.GetTitle().GetFont().SetColor(Color{ 0xff, 0, 0, 0xff });
//Setting the title of category axis of the chart
chart.GetCategoryAxis().GetTitle().SetText(u"Category");
//Setting the title of value axis of the chart
chart.GetValueAxis().GetTitle().SetText(u"Value");

Aspose::Cells::Cleanup();

See Also