diff --git a/docs/assets/option/en/component/label.md b/docs/assets/option/en/component/label.md index 144e5fdf96..b808515bbd 100644 --- a/docs/assets/option/en/component/label.md +++ b/docs/assets/option/en/component/label.md @@ -169,12 +169,19 @@ Overlap avoidance strategy for labels, providing 4 avoidance strategies, respect ```ts export type PositionStrategy = { /** - * 可选位置策略。 - * 若默认位置没有足够的空间放置标签,则考虑 position 内的备选位置。 + * Optional position strategy. + * If the default position does not have enough space to place the label, consider the alternative positions within the position. */ type: 'position'; - /** position 根据图表类型支持不同支持不同的位置配置 **/ + /** position supports different configurations depending on the chart type **/ position?: Functional; + /** + * When the alternative positions in position still cannot accommodate the label, whether the label is returned to its original position. + * The default is true, if false, the label will be placed in the last position of the position array. + * @since 1.12.15 + * @default true + */ + restorePosition?: boolean; }; ``` @@ -183,12 +190,19 @@ Overlap avoidance strategy for labels, providing 4 avoidance strategies, respect ```ts export type BoundStrategy = { /** - * 标签配置在图形内部时使用。 - * 当图形大小不足以放下标签,则考虑 position 内的备选位置。 + * Used when configuring labels inside a graphic. + * If the graphic size is insufficient to accommodate the label, consider alternative positions within the position. */ type: 'bound'; - /** position 根据图表类型支持不同支持不同的位置配置 **/ + /** position supports different configurations depending on the chart type **/ position?: Functional; + /** + * When the alternative positions in position still cannot accommodate the label, whether the label is returned to its original position. + * The default is true, if false, the label will be placed in the last position of the position array. + * @since 1.12.15 + * @default true + */ + restorePosition?: boolean; }; ``` @@ -197,12 +211,12 @@ Overlap avoidance strategy for labels, providing 4 avoidance strategies, respect ```ts export type MoveYStrategy = { /** - * y 方向散开策略。 - * 若默认位置没有足够的空间放置标签,则根据 offset 在 y 方向上寻找位置。 + * Y-direction dispersion strategy. + * If the default position does not have enough space to place the label, find a position in the y-direction based on the offset. */ type: 'moveY'; /** - * y 方向上的尝试的位置偏移量,可配置为函数。 + * The position offset in the y-direction can be configured as a function. */ offset: Functional; // number | (data: any) => number[]; }; @@ -213,12 +227,12 @@ Overlap avoidance strategy for labels, providing 4 avoidance strategies, respect ```ts export type MoveYStrategy = { /** - * x 方向散开策略。 - * 若默认位置没有足够的空间放置标签,则根据 offset 在 x 方向上寻找位置。 + * X-direction dispersion strategy. + * If the default position does not have enough space to place the label, find a position in the x-direction based on the offset. */ type: 'moveX'; /** - * x 方向上的尝试的位置偏移量,可配置为函数。 + * The position offset in the x-direction can be configured as a function. */ offset: Functional; // number | (data: any) => number[]; }; diff --git a/docs/assets/option/zh/component/label.md b/docs/assets/option/zh/component/label.md index 45fbcec7ea..bea2e4e2ce 100644 --- a/docs/assets/option/zh/component/label.md +++ b/docs/assets/option/zh/component/label.md @@ -173,6 +173,13 @@ hover 状态样式配置。 type: 'position'; /** position 根据图表类型支持不同支持不同的位置配置 **/ position?: Functional; + /** + * 当 position 内的备选位置依然无法放下标签时,标签是否放回原位。 + * 默认为 true,若为 false,则标签会被放在 position 数组的最后一个位置。 + * @since 1.12.15 + * @default true + */ + restorePosition?: boolean; }; ``` @@ -187,6 +194,13 @@ hover 状态样式配置。 type: 'bound'; /** position 根据图表类型支持不同支持不同的位置配置 **/ position?: Functional; + /** + * 当 position 内的备选位置依然无法放下标签时,标签是否放回原位。 + * 默认为 true,若为 false,则标签会被放在 position 数组的最后一个位置。 + * @since 1.12.15 + * @default true + */ + restorePosition?: boolean; }; ```