Skip to main content

AlignedTitle.WordWrap Property

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

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.dll

NuGet Package: DevExpress.Charts

Declaration

[TypeConverter(typeof(BooleanTypeConverter))]
[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;

The following code snippets (auto-collected from DevExpress Examples) contain references to the WordWrap property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also