Skip to main content
A newer version of this page is available. .

AlignedTitle.WordWrap Property

Gets or sets whether a title’s text should wrap when it’s too lengthy.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v19.1.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
[XtraSerializableProperty]
public bool WordWrap { get; set; }

Property Value

Type Description
Boolean

true, if a title’s text should wrap; otherwise, false.

Remarks

Use the WordWrap property to enable automatic word wrapping for lengthy titles.

After you enable the WordWrap property, the DockableTitle.MaximumLinesCount property is in effect, allowing you to determine the number of lines that will appear when a title’s text is wrapped. Note that if a title’s length exceeds this limit, the last line of text will be cut off.

The following images demonstrates how these properties work for chart titles.

WordWrap = false

WordWrap = true

MaximumLinesCount = 0

WordWrap = true

MaximumLinesCount = 2

ChartTitles_2a

ChartTitles_2b

ChartTitles_2c

Example

This example demonstrates how word-wrapping can be enabled for chart titles at runtime. In addition, you can determine the maximum number of lines in which a title is allowed to wrap.

// Create a title and add it to the chart's collection.
ChartTitle chartTitle1 = new ChartTitle();
ChartControl1.Titles.Add(chartTitle1);
chartTitle1.Text = "Just a Very Lengthy Title for Such a Small Chart";

// Enable word-wrapping for the title,
// and define a limit for its lines.
chartTitle1.WordWrap = true;
chartTitle1.MaxLineCount = 2;
See Also