Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/undefined point dimension hover #3620

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: undefined points shoulde not show when dimension hover, fix #3610\n\n",
"type": "none",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "[email protected]"
}
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)
xuefei1313 marked this conversation as resolved.
Show resolved Hide resolved
? 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
Loading