From 6ee301d20c9dc30c148f73f0c1dd681be662d534 Mon Sep 17 00:00:00 2001 From: kener Date: Mon, 29 Sep 2014 14:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=A1=AB=E5=85=85=E8=BF=87?= =?UTF-8?q?=E6=B8=A1=E5=8A=A8=E7=94=BBfixed=20http://www.oschina.net/quest?= =?UTF-8?q?ion/2003065=5F173244?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chart/line.js | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/src/chart/line.js b/src/chart/line.js index 73c3703b0..ec8c5f98b 100644 --- a/src/chart/line.js +++ b/src/chart/line.js @@ -917,43 +917,31 @@ define(function (require) { // 主线动画 dx = Math.abs(pointList[0][0] - pointList[1][0]); dy = Math.abs(pointList[0][1] - pointList[1][1]); - isHorizontal = - this.shapeList[i]._orient === 'horizontal'; + isHorizontal = this.shapeList[i]._orient === 'horizontal'; if (aniMap[seriesIndex][2]) { // 队头加入删除末尾 - if (this.shapeList[i].type === 'polygon') { + if (this.shapeList[i].type === 'half-smooth-polygon') { //区域图 var len = pointList.length; - this.shapeList[i].style.pointList[len - 3] - = pointList[len - 2]; - isHorizontal - ? (this.shapeList[i].style.pointList[len - 3][0] - = pointList[len - 4][0] - ) - : (this.shapeList[i].style.pointList[len - 3][1] - = pointList[len - 4][1] - ); - this.shapeList[i].style.pointList[len - 2] - = pointList[len - 1]; + this.shapeList[i].style.pointList[len - 3] = pointList[len - 2]; + this.shapeList[i].style.pointList[len - 3][isHorizontal ? 0 : 1] + = pointList[len - 4][isHorizontal ? 0 : 1] + this.shapeList[i].style.pointList[len - 2] = pointList[len - 1]; } this.shapeList[i].style.pointList.pop(); - isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); } else { // 队尾加入删除头部 this.shapeList[i].style.pointList.shift(); - if (this.shapeList[i].type === 'polygon') { + if (this.shapeList[i].type === 'half-smooth-polygon') { //区域图 - var targetPoint = - this.shapeList[i].style.pointList.pop(); + var targetPoint =this.shapeList[i].style.pointList.pop(); isHorizontal ? (targetPoint[0] = pointList[0][0]) : (targetPoint[1] = pointList[0][1]); - this.shapeList[i].style.pointList.push( - targetPoint - ); + this.shapeList[i].style.pointList.push(targetPoint); } isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); } @@ -1049,7 +1037,6 @@ define(function (require) { n: dy, image: imageLocation }); - } else { ctx.moveTo(x, y + dy); -- GitLab