提交 4c8dd0f7 编写于 作者: K kener

大规模散点图

上级 d4b9d903
......@@ -589,6 +589,8 @@ define(function (require) {
var seriesPL;
var singlePL;
var isLarge;
// 堆叠层叠需求,反顺序构建
for (var seriesIndex = series.length - 1;
seriesIndex >= 0;
......@@ -622,6 +624,8 @@ define(function (require) {
for (var i = 0, l = seriesPL.length; i < l; i++) {
singlePL = seriesPL[i];
isLarge = this._isLarge(orient, singlePL);
if (!isLarge) { // 非大数据模式才显示拐点symbol
for (var j = 0, k = singlePL.length; j < k; j++) {
data = serie.data[singlePL[j][2]];
if (this.deepQuery(
......@@ -646,8 +650,13 @@ define(function (require) {
orient
));
}
}
}
else {
// 大数据模式截取pointList
singlePL = this._getLargePointList(orient, singlePL);
}
// 折线图
this.shapeList.push(new BrokenLineShape({
zlevel : this._zlevelBase,
......@@ -715,6 +724,38 @@ define(function (require) {
}
},
_isLarge : function(orient, singlePL) {
var len = singlePL.length;
if (orient == 'horizontal') {
var width = this.component.grid.getWidth();
return width * 2 < len;
}
else {
var height = this.component.grid.getHeight();
return height * 2 < len;
}
},
/**
* 大规模pointList优化
*/
_getLargePointList : function(orient, singlePL) {
var total;
if (orient == 'horizontal') {
total = this.component.grid.getWidth();
}
else {
total = this.component.grid.getHeight();
}
var len = singlePL.length;
var newList = [];
for (var i = 0; i < total; i++) {
newList[i] = singlePL[Math.floor(len / total * i)];
}
return newList;
},
_getSmooth : function (isSmooth/*, pointList, orient*/) {
if (isSmooth) {
/* 不科学啊,发现0.3通用了
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册