Skip to content

Commit

Permalink
fix: undefined points shoulde not show when dimension hover, fix #3610
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Dec 26, 2024
1 parent 84840db commit 676c1fd
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions packages/vchart/src/series/mixin/line-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface LineLikeSeriesMixin extends ISeries {
_fieldZ?: string[];

_createMark: (markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption, config?: ICompileMarkConfig) => IMark;
_getInvalidDefined: () => boolean;
_getInvalidDefined: (datum: Datum) => boolean;
_getInvalidConnectType: () => IInvalidType;

getLayoutRect: () => ILayoutRect;
Expand Down Expand Up @@ -316,26 +316,21 @@ export class LineLikeSeriesMixin {
'normal',
AttributeLevel.Series
);
if (this._invalidType !== 'zero') {
this.setMarkStyle(
symbolMark,
{
visible: this._getInvalidDefined.bind(this)
},
'normal',
AttributeLevel.Series
);
}

this.event.on(ChartEvent.viewDataStatisticsUpdate, { filter: param => param.model === this }, () => {
this.encodeDefined(symbolMark, 'visible');
});

this.setMarkStyle(
symbolMark,
{
x: this.dataToPositionX.bind(this),
y: this.dataToPositionY.bind(this),
x: (datum: Datum) => {
// 对于symbol而言,如果undefined 的元素还进行scale机会,Null/undefined 会被当成0,导致交互误显示的问题
return this._invalidType !== 'zero' && !this._getInvalidDefined(datum)
? Number.NaN
: this.dataToPositionX(datum);
},
y: (datum: Datum) => {
return this._invalidType !== 'zero' && !this._getInvalidDefined(datum)
? Number.NaN
: this.dataToPositionY(datum);
},
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
},
'normal',
Expand Down

0 comments on commit 676c1fd

Please sign in to comment.