Back to Devexpress

TdxChartCustomLegend.MaxCaptionWidth Property

vcl-dxchartcore-dot-tdxchartcustomlegend-cfc5bbc6.md

latest3.6 KB
Original Source

TdxChartCustomLegend.MaxCaptionWidth Property

Specifies the maximum caption width (in pixels) in multi-column and narrow vertical legend pane layouts.

Declaration

delphi
property MaxCaptionWidth: Single read; write;

Property Value

TypeDescription
Single

The maximum caption width (in pixels) in multi-column and narrow vertical legend pane layouts at 96 DPI.

The property value can be 0 or higher.

|

Remarks

Use the MaxCaptionWidth property to adjust the maximum width of legend item captions when the legend pane width allocated to legend items is limited. For example, the MaxCaptionWidth property is useful when you need to fine tune the legend pane whose maximum width is limited and the Direction property is set to TdxChartLegendDirection.LeftToRight or TdxChartLegendDirection.RightToLeft.

If a legend item caption’s width exceeds the MaxCaptionWidth property value in a horizontal legend pane layout with constrained width, the legend pane truncates the caption and displays an ellipsis.

Property Value Examples

ValueExample[1]
120 ( default )[2]
30[3]

Property Setter Behavior

The MaxCaptionWidth property setter changes an assigned negative value to 0.

Property Values and Scaling

The MaxCaptionWidth property specifies the base maximum legend item caption width (in pixels) that corresponds to 96 DPI. The Chart control’s draw routines multiply the MaxCaptionWidth property value by the current scale factor and round the result to the nearest integer to calculate actual item caption width on the target screen.

Limitations

The MaxCaptionWidth property has no effect when the legend pane allocates sufficient space to display all legend items in full with the current settings.

Default Value

The MaxCaptionWidth property’s default value is the DefaultMaxCaptionWidth typed constant.

Footnotes

  1. This example demonstrates different MaxCaptionWidth property values on the same legend pane under the following conditions:

  2. The maximum caption width allows the legend pane to display item captions in full but the current legend width constraint (MaxWidthPercent is set to 30) arranges legend items in one column.

  3. The maximum caption width truncates legend items so their resulting width allows the legend pane to fit two columns of items into the current legend width constraint (MaxWidthPercent is set to 30).

See Also

TdxChartCustomLegend.Direction Property

TdxChartCustomLegend.MaxWidthPercent Property

TdxChartCustomLegend Class

TdxChartCustomLegend Members

dxChartCore Unit