提交 5a8028f1 编写于 作者: P pah100

add realtime for parallel axis drag

上级 53086b14
......@@ -74,7 +74,8 @@ define(function (require) {
areaSelectStyle
);
selectController.on('selected', zrUtil.bind(this._onSelected, this));
selectController.on('selected', zrUtil.bind(this._onSelected, this, true));
selectController.on('selectEnd', zrUtil.bind(this._onSelected, this, false));
}
selectController.enable(axisGroup);
......@@ -89,7 +90,7 @@ define(function (require) {
selectController.update(ranges);
},
_onSelected: function (ranges) {
_onSelected: function (realtime, ranges) {
// Do not cache these object, because the mey be changed.
var axisModel = this.axisModel;
var axis = axisModel.axis;
......@@ -100,11 +101,15 @@ define(function (require) {
axis.coordToData(range[1], true)
];
});
this.api.dispatchAction({
type: 'axisAreaSelect',
parallelAxisId: axisModel.id,
intervals: intervals
});
// Consider axisModel.option.realtime is null/undefined.
if (!(axisModel.option.realtime ^ realtime)) {
this.api.dispatchAction({
type: 'axisAreaSelect',
parallelAxisId: axisModel.id,
intervals: intervals
});
}
},
/**
......
......@@ -105,6 +105,8 @@ define(function(require) {
opacity: 0.3
},
realtime: true, // Whether realtime update view when select.
z: 10
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册