diff --git a/src/chart/custom/CustomSeries.ts b/src/chart/custom/CustomSeries.ts index 9f11260563..266621baf7 100644 --- a/src/chart/custom/CustomSeries.ts +++ b/src/chart/custom/CustomSeries.ts @@ -117,6 +117,8 @@ export interface CustomBaseElementOption extends Partial & TransitionOptionMixin; // updateDuringAnimation diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index c0950845b4..90f6ad2d13 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -1041,6 +1041,9 @@ function doCreateOrUpdateEl( else if ((el as ECElement).disableMorphing) { (el as ECElement).disableMorphing = false; } + if (elOption.disableTooltip) { + (el as ECElement).disableTooltip = true; + } attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = diff --git a/src/component/tooltip/TooltipView.ts b/src/component/tooltip/TooltipView.ts index d5bf5d8f21..39587cc7a8 100644 --- a/src/component/tooltip/TooltipView.ts +++ b/src/component/tooltip/TooltipView.ts @@ -450,7 +450,7 @@ class TooltipView extends ComponentView { const el = e.target; const tooltipModel = this._tooltipModel; - if (!tooltipModel) { + if (!tooltipModel || el && el.disableTooltip) { return; } diff --git a/src/util/types.ts b/src/util/types.ts index 1d085c198f..08af4a82fc 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -137,6 +137,10 @@ export interface ECElement extends Element { * Force disable morphing */ disableMorphing?: boolean + /** + * Force disable triggering tooltip + */ + disableTooltip?: boolean } export interface DataHost {