mirror of
https://github.com/VisActor/VChart
synced 2024-11-22 17:26:19 +00:00
fix: filter mode error when roam in scrollbar and datazoom
This commit is contained in:
parent
e8a47007e2
commit
9790e7f53e
@ -0,0 +1,10 @@
|
||||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@visactor/vchart",
|
||||
"comment": "fix: default realtime not effect in scrollbar and datazoom. fix#1462",
|
||||
"type": "none"
|
||||
}
|
||||
],
|
||||
"packageName": "@visactor/vchart"
|
||||
}
|
@ -17,6 +17,7 @@ import type { IDataZoomSpec } from './interface';
|
||||
import { IFilterMode } from '../constant';
|
||||
import { Factory } from '../../../core/factory';
|
||||
import type { IZoomable } from '../../../interaction/zoom';
|
||||
import type { CartesianAxis } from '../../axis/cartesian';
|
||||
|
||||
export class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends DataFilterBaseComponent<T> {
|
||||
static type = ComponentTypeEnum.dataZoom;
|
||||
@ -156,14 +157,19 @@ export class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends DataFilte
|
||||
if (!this._stateScale || !this._valueScale) {
|
||||
return;
|
||||
}
|
||||
let stateScaleRange;
|
||||
const relatedAxisRange = (this._relatedAxisComponent as CartesianAxis<any>).getScale().range();
|
||||
if (this._isHorizontal) {
|
||||
this._stateScale.range([0, this._computeWidth() - handlerSize]);
|
||||
stateScaleRange = this._visible ? [0, this._computeWidth() - handlerSize] : relatedAxisRange;
|
||||
this._stateScale.range(stateScaleRange);
|
||||
this._valueScale.range([this._computeHeight() - this._middleHandlerSize, 0]);
|
||||
} else if (this.layoutOrient === 'left') {
|
||||
this._stateScale.range([0, this._computeHeight() - handlerSize]);
|
||||
stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : relatedAxisRange;
|
||||
this._stateScale.range(stateScaleRange);
|
||||
this._valueScale.range([this._computeWidth() - this._middleHandlerSize, 0]);
|
||||
} else {
|
||||
this._stateScale.range([0, this._computeHeight() - handlerSize]);
|
||||
stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : relatedAxisRange;
|
||||
this._stateScale.range(stateScaleRange);
|
||||
this._valueScale.range([0, this._computeWidth() - this._middleHandlerSize]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user