TdxChartCustomLegend.MaxCaptionWidth Property
Specifies the maximum caption width (in pixels) in multi-column and narrow vertical legend pane layouts.
Declaration
property MaxCaptionWidth: Single read; write;
Property Value
Type | Description |
---|---|
Single | The maximum caption width (in pixels) in multi-column and narrow vertical legend pane layouts at The property value can be |
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.
Examples
Value | Example[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.
-
This example demonstrates different
MaxCaptionWidth
property values on the same legend pane under the following conditions:- The Direction property is set to TdxChartLegendDirection.LeftToRight.
- The MaxWidthPercent property is set to
30
. - AlignmentHorz and AlignmentVert properties are set to TdxChartLegendAlignment.Default.
-
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. -
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
).