Skip to main content
All docs
V25.1
  • 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 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

    Value Example[1]
    120 (default)[2] VCL Chart Control: The Default Maximum Caption Width of Legend Items
    30[3] VCL Chart Control: The Reduced Maximum Width of Legend Items

    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