Skip to content

Commit a04129e

Browse files
committed
feat: support autoLabelMaxWidth in circleAxis
1 parent 1025b61 commit a04129e

File tree

3 files changed

+76
-68
lines changed

3 files changed

+76
-68
lines changed

common/autoinstallers/run-script/pnpm-lock.yaml

Lines changed: 67 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/vchart/src/component/axis/polar/axis.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ export abstract class PolarAxis<T extends IPolarAxisCommonSpec = IPolarAxisCommo
442442
innerRadius,
443443
startAngle: this._startAngle,
444444
endAngle: this._endAngle,
445+
layoutRect: this.getRefLayoutRect(),
446+
autoLabelMaxWidth: this._spec.label?.autoLabelMaxWidth ?? false,
445447
sides: this._getRelatedAxis((this._option as any).radiusAxisIndex)?.getSpec()?.grid?.smooth
446448
? undefined
447449
: this.getScale().domain().length

packages/vchart/src/component/axis/polar/interface/spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ export type IPolarAxisLabel = ILabel &
1515
Pick<
1616
AxisLabelOverlap,
1717
'autoHide' | 'autoHideMethod' | 'autoHideSeparation' | 'autoLimit' | 'limitEllipsis' | 'layoutFunc' | 'autoWrap'
18-
>;
18+
> & {
19+
/**
20+
* 标签最大宽度
21+
* @since 2.0.12
22+
*/
23+
autoLabelMaxWidth?: number;
24+
};
1925

2026
export type IPolarAxisCommonSpec = Omit<ICommonAxisSpec, 'center'> & {
2127
/**

0 commit comments

Comments
 (0)