From 7a8f2a9459f5b5f05aedd933c56bb779bf642d6a Mon Sep 17 00:00:00 2001 From: kener Date: Mon, 16 Sep 2013 15:45:49 +0800 Subject: [PATCH] splitLine bug fix fix this https://github.com/ecomfe/echarts/issues/90 --- src/component/categoryAxis.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/component/categoryAxis.js b/src/component/categoryAxis.js index 285014659b..52c2dc60d4 100644 --- a/src/component/categoryAxis.js +++ b/src/component/categoryAxis.js @@ -398,7 +398,7 @@ define(function (require) { yStart : sy, xEnd : x, yEnd : ey, - strokeColor : color[i % colorLength], + strokeColor : color[(i / _interval) % colorLength], lineType : option.splitLine.lineStyle.type, lineWidth : option.splitLine.lineStyle.width } @@ -424,7 +424,7 @@ define(function (require) { yStart : y, xEnd : ex, yEnd : y, - strokeColor : color[i % colorLength], + strokeColor : color[(i / _interval) % colorLength], linetype : option.splitLine.lineStyle.type, lineWidth : option.splitLine.lineStyle.width } @@ -449,7 +449,7 @@ define(function (require) { var lastX = grid.getX(); var curX; - for (var i = 0; i <= dataLength; i++) { + for (var i = 0; i <= dataLength; i += _interval) { curX = i < dataLength ? getCoord(data[i].value || data[i]) : grid.getXend(); @@ -462,7 +462,7 @@ define(function (require) { y : y, width : curX - lastX, height : height, - color : color[i % colorLength] + color : color[(i / _interval) % colorLength] // type : option.splitArea.areaStyle.type, } }; @@ -477,7 +477,7 @@ define(function (require) { var lastYend = grid.getYend(); var curY; - for (var i = 0; i <= dataLength; i++) { + for (var i = 0; i <= dataLength; i += _interval) { curY = i < dataLength ? getCoord(data[i].value || data[i]) : grid.getY(); @@ -490,7 +490,7 @@ define(function (require) { y : curY, width : width, height : lastYend - curY, - color : color[i % colorLength] + color : color[(i / _interval) % colorLength] // type : option.splitArea.areaStyle.type } };