Legend.Title Property
Returns the legend title settings.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v18.2.dll
Declaration
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
[XtraSerializableProperty(XtraSerializationVisibility.Content)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public LegendTitle Title { get; }
Property Value
Type | Description |
---|---|
LegendTitle | An LegendTitle object which provides the legend title settings. |
Remarks
For more information, refer to the Legend Title topic.
Example
To display the legend title, set the TitleBase.Visible property of the Legend.Title
to true and specify the Title.Text of the Legend.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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-add-a-title-to-a-legend-t374911
// 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;
See Also