@@ -128,25 +128,18 @@ class BarChart {
128128 }
129129 } ) ;
130130 }
131- // 如果存在 dataZoom,提前返回
132- if ( this . baseOption . dataZoom [ 0 ] . show === true ) {
133- return ;
134- } ;
135- // 如果用户自定义了 barWidth,提前返回
136- if ( this . iChartOption . itemStyle ?. barWidth ) {
137- return ;
138- }
131+
139132 // 处理用户设置的阈值大于y轴,设置y轴max保证阈值显示
140133 if ( iChartOption . markLine ) {
141134 handleMarkLineMax ( baseOption , this . chartInstance , this . iChartOption ) ;
142135 }
143136
144-
145- if ( ADAPTIVE_THEME . includes ( this . iChartOption . theme ) ) {
137+ // 如果用户自定义了 barWidth 或 存在 dataZoom,则不主动刷新柱宽
138+ if ( ! baseOption . dataZoom ?. [ 0 ] ?. show && ! this . iChartOption . itemStyle ?. barWidth && ADAPTIVE_THEME . includes ( this . iChartOption . theme ) ) {
146139 updateWidth ( baseOption , this . chartInstance , this . iChartOption ) ;
147140 }
148141 // 坐标轴二次计算
149- AdaptiveRectSys ( this . baseOption , this . iChartOption , this . chartInstance , this )
142+ AdaptiveRectSys ( baseOption , this . iChartOption , this . chartInstance , this )
150143
151144 }
152145
@@ -162,20 +155,13 @@ class BarChart {
162155 // 坐标轴二次计算
163156 AdaptiveRectSys ( this . baseOption , this . iChartOption , this . chartInstance , this )
164157 this . baseOption . legend = legend ( this . iChartOption , 'BarChart' , this . chartInstance ) ;
165- callback && callback ( this . baseOption , { notMerge : false } ) ;
166158 }
167- // 如果存在 dataZoom,提前返回
168- if ( this . baseOption . dataZoom [ 0 ] . show === true ) {
169- return ;
170- } ;
171- // 如果用户自定义了 barWidth,提前返回
172- if ( this . iChartOption . itemStyle ?. barWidth ) {
173- return ;
174- }
175- if ( ADAPTIVE_THEME . includes ( this . iChartOption . theme ) ) {
159+
160+ // 如果用户自定义了 barWidth 或 存在 dataZoom,则不主动刷新柱宽
161+ if ( ! this . baseOption . dataZoom ?. [ 0 ] ?. show && ! this . iChartOption . itemStyle ?. barWidth && ADAPTIVE_THEME . includes ( this . iChartOption . theme ) ) {
176162 updateWidth ( this . baseOption , this . chartInstance , this . iChartOption ) ;
177- callback && callback ( this . baseOption , { notMerge : false } ) ;
178163 }
164+ callback && callback ( this . baseOption , { notMerge : false } ) ;
179165 }
180166}
181167
0 commit comments