Skip to content

Commit

Permalink
fix: fix the specXField need transform to array
Browse files Browse the repository at this point in the history
  • Loading branch information
xuefei1313 authored and kkxxkk2019 committed Oct 26, 2023
1 parent 804252f commit dd60436
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions packages/vchart/src/series/cartesian/cartesian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export abstract class CartesianSeries<T extends ICartesianSeriesSpec = ICartesia
this._fieldY2 = f;
}

protected _specXField: string[];
protected _specYField: string[];

protected _direction: DirectionType = Direction.vertical;
get direction() {
return this._direction;
Expand Down Expand Up @@ -246,6 +249,8 @@ export abstract class CartesianSeries<T extends ICartesianSeriesSpec = ICartesia
this.setFieldX(this._spec.xField);
this.setFieldY(this._spec.yField);
this.setFieldZ(this._spec.zField);
this._specXField = array(this._spec.xField);
this._specYField = array(this._spec.yField);
if (isValid(this._spec.direction)) {
this._direction = this._spec.direction;
}
Expand Down Expand Up @@ -452,11 +457,12 @@ export abstract class CartesianSeries<T extends ICartesianSeriesSpec = ICartesia

protected _getInvalidDefined = (datum: Datum) => {
if (this._xAxisHelper.isContinuous) {
if (!couldBeValidNumber(datum[this._spec.xField[0]])) {
if (!couldBeValidNumber(datum[this._specXField[0]])) {
return false;
}
} else if (this._yAxisHelper.isContinuous) {
if (!couldBeValidNumber(datum[this._spec.yField[0]])) {
}
if (this._yAxisHelper.isContinuous) {
if (!couldBeValidNumber(datum[this._specYField[0]])) {
return false;
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/vchart/src/series/polar/polar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ export abstract class PolarSeries<T extends IPolarSeriesSpec = IPolarSeriesSpec>
if (!couldBeValidNumber(datum[this._angleField[0]])) {
return false;
}
} else if (this.radiusAxisHelper.isContinuous) {
}
if (this.radiusAxisHelper.isContinuous) {
if (!couldBeValidNumber(datum[this._radiusField[0]])) {
return false;
}
Expand Down

0 comments on commit dd60436

Please sign in to comment.