AlignedTitle.MaxLineCount Property

Gets or sets the number of lines to which a title's text is allowed to wrap.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.1.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public int MaxLineCount { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property MaxLineCount As Integer

Property Value

Type Description
Int32

An integer which is the number of text lines. Should be greater than or equal to 0 and less than or equal to 20.

Remarks

Use the MaxLineCount property to define the number of lines to which a title is allowed to wrap when its DevExpress.XtraCharts.DockableTitle.WordWrap property is enabled. Both these properties allow you to control a diagram's size when a title is too lengthy.

Note that if a title's length exceeds the limit defined by the MaxLineCount property, the last line of text will be cut off by an ellipsis. To force a chart title to fully display its contents without regard to the title's size, and therefore the chart's diagram dimensions, set the MaxLineCount property to 0.

The following images demonstrate how these properties work for a chart title.

WordWrap = false

WordWrap = true

MaxLinesCount = 0

WordWrap = true

MaxLinesCount = 2

ChartTitles_2a

ChartTitles_2b

ChartTitles_2c

Examples

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