Skip to content

Commit 9151b45

Browse files
authored
fix(GaugeChart): cloud theme display anomaly when custom width is set (#421)
1 parent 9a03ad7 commit 9151b45

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/GaugeChart/handleSeries.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ export function handleSeries(iChartOption, optionColor, containerWidth, containe
599599
const text = iChartOption.text || {};
600600
const axisLabelStyle = iChartOption.axisLabelStyle || {};
601601
const { silent, itemStyle } = iChartOption;
602+
const barWidth = chartToken.barWidth;
602603
const radiusSize = containerWidth > containerHeight ? containerHeight : containerWidth;
603604
// 更改仪表盘轨道底色
604605
handleTheme(iChartOption);
@@ -608,7 +609,7 @@ export function handleSeries(iChartOption, optionColor, containerWidth, containe
608609
} else {
609610
seriesInit.axisLabel['color'] = chartToken.descRichColor;
610611
}
611-
seriesInit.axisLabel['distance'] = axisLabelStyle['distance'] || (itemStyle?.width && Number(itemStyle?.width) + 6) || 22;
612+
seriesInit.axisLabel['distance'] = axisLabelStyle['distance'] || Number(itemStyle?.width || barWidth) + 6 || 22;
612613
seriesInit.axisLabel['fontWeight'] = axisLabelStyle['fontWeight'] || 400;
613614
seriesInit.axisLabel['fontSize'] = axisLabelStyle['fontSize'] || 14;
614615
// 组装数据

0 commit comments

Comments
 (0)