未验证 提交 80d389f7 编写于 作者: S sushuang 提交者: GitHub

Merge pull request #12147 from susiwen8/#12121

Fix: minOpen is true will drop a piece
......@@ -398,25 +398,21 @@ var resetMethods = {
thisOption.precision = precision;
splitStep = +splitStep.toFixed(precision);
var index = 0;
if (thisOption.minOpen) {
pieceList.push({
index: index++,
interval: [-Infinity, dataExtent[0]],
close: [0, 0]
});
}
for (
var curr = dataExtent[0], len = index + splitNumber;
index < len;
curr += splitStep
var index = 0, curr = dataExtent[0];
index < splitNumber;
curr += splitStep, index++
) {
var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);
pieceList.push({
index: index++,
interval: [curr, max],
close: [1, 1]
});
......@@ -424,7 +420,6 @@ var resetMethods = {
if (thisOption.maxOpen) {
pieceList.push({
index: index++,
interval: [dataExtent[1], Infinity],
close: [0, 0]
});
......@@ -432,7 +427,8 @@ var resetMethods = {
reformIntervals(pieceList);
zrUtil.each(pieceList, function (piece) {
zrUtil.each(pieceList, function (piece, index) {
piece.index = index;
piece.text = this.formatValueText(piece.interval);
}, this);
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册