LegendTitle Class
An individual legend title.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.dll
NuGet Package: DevExpress.Charts
Declaration
public class LegendTitle :
AlignedTitle,
ITextPropertiesProvider,
IHitTest,
ISupportTextAntialiasing
Related API Members
The following members return LegendTitle objects:
Remarks
The LegendTitle class declares properties that define the common appearance settings of a title which is displayed by a particular legend.
Properties exposed by the LegendTitle class allow you to customize common title attributes, such as:
- the legend title text (Title.Text),
- the color and font settings of the title’s text (TitleBase.TextColor and TitleBase.Font),
- the alignment of the axis title (AlignedTitle.Alignment),
- the visibility of the axis title (TitleBase.Visible).
For more information, refer to Legend Title.
Example
To display the legend title, set the TitleBase.Visible property of the LegendBase.Title to true and specify the Title.Text of the LegendBase.Title. To customize the appearance of the title, you can change, for example, the AlignedTitle.Alignment, AlignedTitle.WordWrap and AlignedTitle.MaxLineCount properties to align the title to the left and divide it into several lines.
// Specify legend title's text.
chart.Legend.Title.Text = "Area of countries";
// Show legend title.
chart.Legend.Title.Visible = true;
// Configure legend title appearance.
chart.Legend.Title.Alignment = StringAlignment.Near;
chart.Legend.Title.MaxLineCount = 3;
chart.Legend.Title.WordWrap = true;