File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/vchart/src/chart/base Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1396,12 +1396,18 @@ export class BaseChart<T extends IChartSpec> extends CompilableBase implements I
13961396 } ) ;
13971397 const isUnableValue =
13981398 isNil ( value ) || ! dimensionInfo || dimensionInfo . every ( d => isDiscrete ( d . axis . getScale ( ) . type ) && isNil ( d . index ) ) ;
1399+
1400+ const isUnableTooltip =
1401+ // 如果数据本身不可用
1402+ isUnableValue ||
1403+ // 或者数据为空
1404+ dimensionInfo . every ( d => isDiscrete ( d . axis . getScale ( ) . type ) && d . data . every ( _data => _data . datum . length === 0 ) ) ;
13991405 // tooltip
14001406 if ( opt . tooltip !== false ) {
14011407 const tooltip = this . getComponentsByType ( ComponentTypeEnum . tooltip ) [ 0 ] as unknown as ITooltip ;
14021408
14031409 if ( tooltip ?. getVisible ( ) ) {
1404- if ( isUnableValue ) {
1410+ if ( isUnableValue || isUnableTooltip ) {
14051411 ( < any > tooltip ) . hideTooltip ?.( ) ;
14061412 } else {
14071413 const dataFilter : { [ key : string ] : any } = { } ;
You can’t perform that action at this time.
0 commit comments