Skip to content

Commit

Permalink
dataZoom getDetail bug fix #1320
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Mar 5, 2015
1 parent dede7bc commit ea6531b
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/component/dataZoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,23 +890,26 @@ define(function (require) {
* 获取当前定位
*/
_getDetail : function () {
var key = this.zoomOption.orient == 'horizontal' ? 'xAxis' : 'yAxis';
var target = this._originalData[key];
for (var idx in target) {
var data = target[idx];
if (data == null) {
continue;
var key = ['xAxis', 'yAxis'];
for (var i = 0, l = key.length; i < l; i++) {
var target = this._originalData[key[i]];
for (var idx in target) {
var data = target[idx];
if (data == null) {
continue;
}
var length = data.length;
var start = Math.floor(this._zoom.start / 100 * length);
var end = Math.ceil(this._zoom.end / 100 * length);
end -= end > 0 ? 1 : 0;
return {
start : this.getDataFromOption(data[start]),
end : this.getDataFromOption(data[end])
};
}
var length = data.length;
var start = Math.floor(this._zoom.start / 100 * length);
var end = Math.ceil(this._zoom.end / 100 * length);
end -= end > 0 ? 1 : 0;
return {
start : this.getDataFromOption(data[start]),
end : this.getDataFromOption(data[end])
};
}


key = this.zoomOption.orient == 'horizontal' ? 'xAxis' : 'yAxis';
var seriesIndex = this._zoom.seriesIndex[0];
var axisIndex = this.option.series[seriesIndex][key + 'Index'] || 0;
var axisType = this.option[key][axisIndex].type;
Expand Down

1 comment on commit ea6531b

@ruicongMa
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新版的echarts
toolbox: {
show: true,
orient: 'vertical',
feature: {
dataZoom: {
show: true // 设置为false有bug
},
dataView: {
show: false
},
magicType: {
type: ['line', 'bar']
},
restore: {},
saveAsImage: {}
}
}

dataZoom: { show: false} 设置为false 切换line bar 按钮时 有bug。这个问题解决了吗?

Please sign in to comment.