Skip to main content

AxisLabel.MaxWidth Property

Gets or sets the maximum width allowed for axis labels.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.dll

NuGet Package: DevExpress.Charts

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
[XtraSerializableProperty]
public int MaxWidth { get; set; }

Property Value

Type Description
Int32

An integer value that specifies the maximum label width. By default, it is set to 0, which means that label width is unlimited.

Remarks

When the width of axis labels is limited by the MaxWidth property value or if an axis label’s text contains new line characters, its text is split across multiple lines. In this case, the AxisLabel.MaxLineCount property helps you control the number of allowed text lines when axis labels are too lengthy.

Important

This property specifies the label length in pixels.

Note that if a label’s length exceeds the limit defined by the AxisLabel.MaxLineCount property, the last line of text will be cut off by an ellipsis. To force an axis label to fully display its contents without regard to the label’s size, set the AxisLabel.MaxLineCount property to 0.

The following images demonstrate how these properties work.

Property values Resulting image
MaxWidth = 0; MaxLineCount = 0; AxisLabels_MaxWidth0MaxLineCount0
MaxWidth = 70; MaxLineCount = 0; AxisLabels_MaxWidth70MaxLineCount0
MaxWidth = 70; MaxLineCount = 2; AxisLabels_MaxWidth65MaxLineCount2
See Also