Skip to content

Commit 55e0282

Browse files
committed
Merge branch 'master' of https://github.com/ecomfe/echarts
2 parents b21bd32 + ffc3f40 commit 55e0282

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

src/component/dataRange.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -835,19 +835,9 @@ define(function (require) {
835835
}
836836

837837
if (e._type == 'filler') {
838-
_fillerShae.style.x = e.style.x;
839-
_fillerShae.style.y = e.style.y;
840838
_syncHandleShape();
841839
}
842840
else {
843-
if (e.id == _startShape.id) {
844-
_startShape.style.x = e.style.x;
845-
_startShape.style.y = e.style.y;
846-
}
847-
else {
848-
_endShape.style.x = e.style.x;
849-
_endShape.style.y = e.style.y;
850-
}
851841
_syncFillerShape(e);
852842
}
853843

@@ -1133,11 +1123,24 @@ define(function (require) {
11331123
: dataRangeOption.splitNumber;
11341124
_colorList = zrColor.getGradientColors(
11351125
dataRangeOption.color,
1136-
(splitNumber - dataRangeOption.color.length)
1137-
/ (dataRangeOption.color.length - 1) + 1
1126+
Math.max(
1127+
(splitNumber - dataRangeOption.color.length)
1128+
/ (dataRangeOption.color.length - 1),
1129+
0
1130+
) + 1
11381131
);
1139-
_colorList = _colorList.slice(0, splitNumber);
1140-
//console.log(_colorList.length)
1132+
1133+
if (_colorList.length > splitNumber) {
1134+
var len = _colorList.length;
1135+
var newColorList = [_colorList[0]];
1136+
var step = len / (splitNumber - 1);
1137+
for (var i = 1; i < splitNumber - 1; i++) {
1138+
newColorList.push(_colorList[Math.floor(i * step)])
1139+
}
1140+
newColorList.push(_colorList[len - 1]);
1141+
_colorList = newColorList;
1142+
}
1143+
// console.log(_colorList.length)
11411144

11421145
if (dataRangeOption.precision === 0) {
11431146
_gap = Math.round(

src/component/dataZoom.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -589,19 +589,9 @@ define(function (require) {
589589
}
590590

591591
if (e._type == 'filler') {
592-
_fillerShae.style.x = e.style.x;
593-
_fillerShae.style.y = e.style.y;
594592
_syncHandleShape();
595593
}
596594
else {
597-
if (e.id == _startShape.id) {
598-
_startShape.style.x = e.style.x;
599-
_startShape.style.y = e.style.y;
600-
}
601-
else {
602-
_endShape.style.x = e.style.x;
603-
_endShape.style.y = e.style.y;
604-
}
605595
_syncFillerShape();
606596
}
607597

0 commit comments

Comments
 (0)