ChartTitle Class
Represents a chart or axis title.
- Inheritance:
- System.ObjectChartTitle
Properties
AllowOverlap
Gets or sets a value indicating whether title overlaps chart's plot area or resizes it.
Property Value
- System.Boolean
true if title overlaps chart's plot area without resizing it; otherwise, false if title doesn't overlap chart's plot area but resizes it instead.
CustomLayout
Gets or sets the title custom layout.
public ChartElementLayout CustomLayout { get; set; }
Public Property CustomLayout As ChartElementLayout
Property Value
The configuration of how the title should be positioned inside the chart.
Direction
Gets or sets the title text direction.
public ChartTitleDirection Direction { get; set; }
Public Property Direction As ChartTitleDirection
Property Value
The title text direction.
DisplayText
Gets the title display text. If IsVisible is false, then System.String.Empty is returned; otherwise, if Text is direct value, then Text value is returned; otherwise, if Text is a cell reference, then referenced cell value is returned; otherwise, default title is returned.
Property Value
- System.String
The title display text.
Fill
Gets or sets the fill formatting options.
Property Value
The fill formatting options.
IsVisible
Gets or sets a value indicating whether title is visible.
Property Value
- System.Boolean
true if title is visible; otherwise, false.
Remarks
Default value of this property is false.
If title is not visible, its properties won't be saved when saving a workbook into XLSX format.
Outline
Gets or sets the outline formatting options.
Property Value
The outline formatting options.
RichText
Gets the title's rich text, which can be used to partially format the title content. Set the rich text by using SetRichText().
Property Value
Text
Gets or sets the title text as direct value (for example, 'My chart title') or as a reference to a cell with value (for example, '=Sheet1!A1'). If set value is not null nor System.String.Empty, then IsVisible is set to true.
Property Value
- System.String
The title text.
TextFormat
Gets or sets the text formatting options.
Property Value
The text formatting options.
Methods
Delete()
Deletes the title.
SetRichText()
Defines this chart title as rich text, enabling the usage of RichText. It is possible to use the RichText property to set multiple formats to different parts of the title.
Returns
Remarks
Using this method will erase the current title.
ToString()
Returns the DisplayText value.
Returns
- System.String
The DisplayText value.