evui 3.4.127 → 3.4.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evui.common.js +731 -286
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +731 -286
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chart/chart.core.js +4 -3
- package/src/components/chart/element/element.bar.js +131 -61
- package/src/components/chart/element/element.line.js +11 -9
- package/src/components/chart/element/element.scatter.js +20 -4
- package/src/components/chart/element/element.tip.js +120 -60
- package/src/components/chart/helpers/helpers.util.js +19 -15
- package/src/components/chart/model/model.store.js +40 -17
- package/src/components/chart/plugins/plugins.interaction.js +69 -8
- package/src/components/chart/plugins/plugins.legend.js +4 -6
- package/src/components/chart/plugins/plugins.tooltip.js +15 -4
- package/src/components/chart/scale/scale.js +17 -7
- package/src/components/chart/scale/scale.linear.js +183 -3
- package/src/components/chart/uses.js +2 -0
package/dist/evui.common.js
CHANGED
|
@@ -11174,7 +11174,7 @@ module.exports = exports;
|
|
|
11174
11174
|
/***/ "9224":
|
|
11175
11175
|
/***/ (function(module) {
|
|
11176
11176
|
|
|
11177
|
-
module.exports = JSON.parse("{\"a\":\"3.4.
|
|
11177
|
+
module.exports = JSON.parse("{\"a\":\"3.4.129\"}");
|
|
11178
11178
|
|
|
11179
11179
|
/***/ }),
|
|
11180
11180
|
|
|
@@ -38503,26 +38503,26 @@ var es_string_match = __webpack_require__("466d");
|
|
|
38503
38503
|
return value;
|
|
38504
38504
|
}
|
|
38505
38505
|
|
|
38506
|
-
var
|
|
38507
|
-
|
|
38508
|
-
return "".concat((v / target).toFixed(decimalPoint)).concat(lb);
|
|
38509
|
-
}
|
|
38506
|
+
var isNegative = value < 0;
|
|
38507
|
+
var absValue = Math.abs(value);
|
|
38510
38508
|
|
|
38511
|
-
|
|
38512
|
-
|
|
38513
|
-
|
|
38514
|
-
|
|
38515
|
-
|
|
38516
|
-
|
|
38517
|
-
label = assignLabelWith(
|
|
38518
|
-
} else if (
|
|
38519
|
-
label = assignLabelWith(
|
|
38520
|
-
} else if (
|
|
38521
|
-
label = assignLabelWith(
|
|
38522
|
-
} else if (
|
|
38523
|
-
label = assignLabelWith(
|
|
38509
|
+
var assignLabelWith = function assignLabelWith(v, target, lb) {
|
|
38510
|
+
var result = v % target === 0 ? "".concat((v / target).toFixed(decimalPoint)).concat(lb) : "".concat((v / target).toFixed(1)).concat(lb);
|
|
38511
|
+
return isNegative ? "-".concat(result) : result;
|
|
38512
|
+
};
|
|
38513
|
+
|
|
38514
|
+
if (absValue >= quad) {
|
|
38515
|
+
label = assignLabelWith(absValue, quad, 'P');
|
|
38516
|
+
} else if (absValue >= trill) {
|
|
38517
|
+
label = assignLabelWith(absValue, trill, 'T');
|
|
38518
|
+
} else if (absValue >= billi) {
|
|
38519
|
+
label = assignLabelWith(absValue, billi, 'G');
|
|
38520
|
+
} else if (absValue >= milli) {
|
|
38521
|
+
label = assignLabelWith(absValue, milli, 'M');
|
|
38522
|
+
} else if (absValue >= killo) {
|
|
38523
|
+
label = assignLabelWith(absValue, 1000, 'K');
|
|
38524
38524
|
} else {
|
|
38525
|
-
label = value.toFixed(decimalPoint);
|
|
38525
|
+
label = isNegative ? "-".concat(absValue.toFixed(decimalPoint)) : value.toFixed(decimalPoint);
|
|
38526
38526
|
}
|
|
38527
38527
|
|
|
38528
38528
|
return label;
|
|
@@ -38796,21 +38796,23 @@ var modules = {
|
|
|
38796
38796
|
seriesIDs.forEach(function (seriesID) {
|
|
38797
38797
|
var series = _this.seriesList[seriesID];
|
|
38798
38798
|
var sData = data[seriesID];
|
|
38799
|
+
var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
|
|
38799
38800
|
|
|
38800
38801
|
if (series && sData) {
|
|
38801
38802
|
series.data = _this.addSeriesDSforScatter(sData);
|
|
38802
|
-
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38803
|
+
series.minMax = _this.getSeriesMinMax(series.data, passingValue);
|
|
38803
38804
|
}
|
|
38804
38805
|
});
|
|
38805
38806
|
} else if (typeKey === 'heatMap') {
|
|
38806
38807
|
seriesIDs.forEach(function (seriesID) {
|
|
38807
38808
|
var series = _this.seriesList[seriesID];
|
|
38809
|
+
var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
|
|
38808
38810
|
var sData = data[seriesID];
|
|
38809
38811
|
|
|
38810
38812
|
if (series && sData) {
|
|
38811
38813
|
series.labels = label;
|
|
38812
38814
|
series.data = _this.addSeriesDSForHeatMap(sData);
|
|
38813
|
-
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38815
|
+
series.minMax = _this.getSeriesMinMax(series.data, passingValue);
|
|
38814
38816
|
series.valueOpt = _this.getSeriesValueOptForHeatMap(series);
|
|
38815
38817
|
}
|
|
38816
38818
|
});
|
|
@@ -38842,7 +38844,7 @@ var modules = {
|
|
|
38842
38844
|
series.data = _this.addSeriesDS(sData, label, series.isExistGrp);
|
|
38843
38845
|
}
|
|
38844
38846
|
|
|
38845
|
-
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38847
|
+
series.minMax = _this.getSeriesMinMax(series.data, series.passingValue);
|
|
38846
38848
|
}
|
|
38847
38849
|
});
|
|
38848
38850
|
}
|
|
@@ -39238,17 +39240,19 @@ var modules = {
|
|
|
39238
39240
|
var isHorizontal = this.options.horizontal;
|
|
39239
39241
|
var sdata = [];
|
|
39240
39242
|
|
|
39241
|
-
var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex) {
|
|
39243
|
+
var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex, curr) {
|
|
39242
39244
|
var nextBaseSeriesIndex = baseIndex - 1;
|
|
39243
39245
|
var baseSeries = _this4.seriesList[bsIds[baseIndex]];
|
|
39244
39246
|
var baseDataList = baseSeries.data;
|
|
39245
39247
|
var baseData = baseDataList[dataIndex];
|
|
39246
39248
|
var position = isHorizontal ? baseData === null || baseData === void 0 ? void 0 : baseData.x : baseData === null || baseData === void 0 ? void 0 : baseData.y;
|
|
39247
|
-
var
|
|
39249
|
+
var baseValue = baseData === null || baseData === void 0 ? void 0 : baseData.o;
|
|
39250
|
+
var isPassingValue = !helpers_util.isNullOrUndefined(baseSeries === null || baseSeries === void 0 ? void 0 : baseSeries.passingValue) && (baseSeries === null || baseSeries === void 0 ? void 0 : baseSeries.passingValue) === baseValue;
|
|
39251
|
+
var isSameSign = curr >= 0 && baseValue >= 0 || curr < 0 && baseValue < 0;
|
|
39248
39252
|
|
|
39249
|
-
if (isPassingValue || position == null || !baseSeries.show) {
|
|
39253
|
+
if (isPassingValue || position == null || !isSameSign || !baseSeries.show) {
|
|
39250
39254
|
if (nextBaseSeriesIndex > -1) {
|
|
39251
|
-
return getBaseDataPosition(nextBaseSeriesIndex, dataIndex);
|
|
39255
|
+
return getBaseDataPosition(nextBaseSeriesIndex, dataIndex, curr);
|
|
39252
39256
|
}
|
|
39253
39257
|
|
|
39254
39258
|
return 0;
|
|
@@ -39259,7 +39263,7 @@ var modules = {
|
|
|
39259
39263
|
|
|
39260
39264
|
data.forEach(function (curr, index) {
|
|
39261
39265
|
var baseIndex = bsIds.length - 1 < 0 ? 0 : bsIds.length - 1;
|
|
39262
|
-
var bdata = getBaseDataPosition(baseIndex, index); // base(previous) series data
|
|
39266
|
+
var bdata = getBaseDataPosition(baseIndex, index, curr); // base(previous) series data
|
|
39263
39267
|
|
|
39264
39268
|
var odata = curr; // current series original data
|
|
39265
39269
|
|
|
@@ -39442,7 +39446,7 @@ var modules = {
|
|
|
39442
39446
|
*
|
|
39443
39447
|
* @returns {object} min/max info for series
|
|
39444
39448
|
*/
|
|
39445
|
-
getSeriesMinMax: function getSeriesMinMax(data) {
|
|
39449
|
+
getSeriesMinMax: function getSeriesMinMax(data, passingValue) {
|
|
39446
39450
|
var def = {
|
|
39447
39451
|
minX: null,
|
|
39448
39452
|
minY: null,
|
|
@@ -39453,22 +39457,24 @@ var modules = {
|
|
|
39453
39457
|
var isHorizontal = this.options.horizontal;
|
|
39454
39458
|
|
|
39455
39459
|
if (data.length) {
|
|
39460
|
+
var usePassingValue = !helpers_util.isNullOrUndefined(passingValue);
|
|
39456
39461
|
return data.reduce(function (acc, p, index) {
|
|
39457
|
-
var _p$x, _p$y;
|
|
39462
|
+
var _p$x, _p$y, _p$o;
|
|
39458
39463
|
|
|
39459
39464
|
var minmax = acc;
|
|
39460
39465
|
var px = ((_p$x = p.x) === null || _p$x === void 0 ? void 0 : _p$x.value) || p.x;
|
|
39461
39466
|
var py = ((_p$y = p.y) === null || _p$y === void 0 ? void 0 : _p$y.value) || p.y;
|
|
39467
|
+
var po = ((_p$o = p.o) === null || _p$o === void 0 ? void 0 : _p$o.value) || p.o;
|
|
39462
39468
|
|
|
39463
|
-
if (px <= minmax.minX) {
|
|
39469
|
+
if (usePassingValue ? po !== passingValue && px <= minmax.minX : px <= minmax.minX) {
|
|
39464
39470
|
minmax.minX = px === null ? 0 : px;
|
|
39465
39471
|
}
|
|
39466
39472
|
|
|
39467
|
-
if (py <= minmax.minY) {
|
|
39473
|
+
if (usePassingValue ? po !== passingValue && py <= minmax.minY : py <= minmax.minY) {
|
|
39468
39474
|
minmax.minY = py === null ? 0 : py;
|
|
39469
39475
|
}
|
|
39470
39476
|
|
|
39471
|
-
if (px >= minmax.maxX) {
|
|
39477
|
+
if (usePassingValue ? po !== passingValue && px >= minmax.maxX : px >= minmax.maxX) {
|
|
39472
39478
|
minmax.maxX = px === null ? 0 : px;
|
|
39473
39479
|
|
|
39474
39480
|
if (isHorizontal && px !== null) {
|
|
@@ -39477,7 +39483,7 @@ var modules = {
|
|
|
39477
39483
|
}
|
|
39478
39484
|
}
|
|
39479
39485
|
|
|
39480
|
-
if (py >= minmax.maxY) {
|
|
39486
|
+
if (usePassingValue ? po !== passingValue && py >= minmax.maxY : py >= minmax.maxY) {
|
|
39481
39487
|
minmax.maxY = py === null ? 0 : py;
|
|
39482
39488
|
|
|
39483
39489
|
if (!isHorizontal && py !== null) {
|
|
@@ -40231,14 +40237,25 @@ var modules = {
|
|
|
40231
40237
|
}
|
|
40232
40238
|
}
|
|
40233
40239
|
|
|
40234
|
-
|
|
40240
|
+
var isExistGrp = _this10.seriesList[key].isExistGrp;
|
|
40241
|
+
var maxXisNegative = minmax.x[axisX].max < 0;
|
|
40242
|
+
|
|
40243
|
+
if (isExistGrp && maxXisNegative) {
|
|
40244
|
+
minmax.x[axisX].max = smm.maxX;
|
|
40245
|
+
minmax.x[axisX].maxSID = key;
|
|
40246
|
+
} else if (!minmax.x[axisX].max || smm.maxX >= minmax.x[axisX].max) {
|
|
40235
40247
|
minmax.x[axisX].max = smm.maxX;
|
|
40236
40248
|
minmax.x[axisX].maxSID = key;
|
|
40237
40249
|
}
|
|
40238
40250
|
|
|
40239
|
-
|
|
40251
|
+
var maxYisNegative = minmax.y[axisY].max < 0;
|
|
40252
|
+
|
|
40253
|
+
if (isExistGrp && maxYisNegative) {
|
|
40254
|
+
minmax.y[axisY].max = smm.maxY;
|
|
40255
|
+
minmax.y[axisY].maxSID = key;
|
|
40256
|
+
} else if (!minmax.y[axisY].max || smm.maxY >= minmax.y[axisY].max) {
|
|
40240
40257
|
minmax.y[axisY].max = smm.maxY;
|
|
40241
|
-
minmax.y[
|
|
40258
|
+
minmax.y[axisY].maxSID = key;
|
|
40242
40259
|
}
|
|
40243
40260
|
}
|
|
40244
40261
|
|
|
@@ -41699,6 +41716,7 @@ var TIME_INTERVALS = {
|
|
|
41699
41716
|
|
|
41700
41717
|
|
|
41701
41718
|
|
|
41719
|
+
|
|
41702
41720
|
var element_line_Line = /*#__PURE__*/function () {
|
|
41703
41721
|
function Line(sId, opt, sIdx) {
|
|
41704
41722
|
var _this = this;
|
|
@@ -41832,7 +41850,6 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41832
41850
|
ctx.setLineDash(this.segments);
|
|
41833
41851
|
}
|
|
41834
41852
|
|
|
41835
|
-
var endPoint = chartRect.y2 - labelOffset.bottom;
|
|
41836
41853
|
var isLinearInterpolation = this.useLinearInterpolation();
|
|
41837
41854
|
var barAreaByCombo = 0;
|
|
41838
41855
|
var minmaxX = axesSteps.x[this.xAxisIndex];
|
|
@@ -41855,8 +41872,12 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41855
41872
|
|
|
41856
41873
|
var getYPos = function getYPos(val) {
|
|
41857
41874
|
return helpers_canvas.calculateY(val, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
41858
|
-
};
|
|
41875
|
+
};
|
|
41859
41876
|
|
|
41877
|
+
var includeNegativeValue = this.data.some(function (data) {
|
|
41878
|
+
return data.o < 0;
|
|
41879
|
+
});
|
|
41880
|
+
var endPoint = includeNegativeValue ? getYPos(0) : chartRect.y2 - labelOffset.bottom; // draw line
|
|
41860
41881
|
|
|
41861
41882
|
var prevValid;
|
|
41862
41883
|
this.data.forEach(function (curr) {
|
|
@@ -41916,9 +41937,10 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41916
41937
|
}
|
|
41917
41938
|
});
|
|
41918
41939
|
var gradient = ctx.createLinearGradient(0, chartRect.y2, 0, maxValueYPos);
|
|
41919
|
-
|
|
41940
|
+
var mainGradientColor = extent.opacity < 1 ? fillColor : mainColor;
|
|
41941
|
+
gradient.addColorStop(0, includeNegativeValue ? mainGradientColor : fillColor);
|
|
41920
41942
|
gradient.addColorStop(0.5, fillColor);
|
|
41921
|
-
gradient.addColorStop(1,
|
|
41943
|
+
gradient.addColorStop(1, mainGradientColor);
|
|
41922
41944
|
ctx.fillStyle = gradient;
|
|
41923
41945
|
} else {
|
|
41924
41946
|
ctx.fillStyle = fillColor;
|
|
@@ -41986,7 +42008,7 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41986
42008
|
|
|
41987
42009
|
var nextData = _this2.data[jx];
|
|
41988
42010
|
var xp = getXPos(nextData.x);
|
|
41989
|
-
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 :
|
|
42011
|
+
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : getYPos(0);
|
|
41990
42012
|
ctx.lineTo(xp, bp);
|
|
41991
42013
|
}
|
|
41992
42014
|
|
|
@@ -42097,22 +42119,23 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
42097
42119
|
|
|
42098
42120
|
var s = 0;
|
|
42099
42121
|
var e = gdata.length - 1;
|
|
42100
|
-
var
|
|
42122
|
+
var gap = Math.ceil(Math.abs(((_gdata$ = gdata[1]) === null || _gdata$ === void 0 ? void 0 : _gdata$.xp) - gdata[0].xp) / 2) || 0;
|
|
42123
|
+
var xpInterval = Math.max(gap, 6);
|
|
42101
42124
|
|
|
42102
42125
|
while (s <= e) {
|
|
42103
42126
|
var m = Math.floor((s + e) / 2);
|
|
42104
42127
|
var x = gdata[m].xp;
|
|
42105
42128
|
var y = gdata[m].yp;
|
|
42106
42129
|
|
|
42107
|
-
if (x - xpInterval
|
|
42130
|
+
if (x - xpInterval <= xp && xp <= x + xpInterval) {
|
|
42108
42131
|
var _gdata$m, _gdata$xp, _gdata, _gdata2, _gdata3;
|
|
42109
42132
|
|
|
42110
42133
|
var curXpInterval = ((_gdata$m = gdata[m]) === null || _gdata$m === void 0 ? void 0 : _gdata$m.xp) - ((_gdata$xp = (_gdata = gdata[m - 1]) === null || _gdata === void 0 ? void 0 : _gdata.xp) !== null && _gdata$xp !== void 0 ? _gdata$xp : 0);
|
|
42111
42134
|
|
|
42112
42135
|
if ((_gdata2 = gdata[m - 1]) !== null && _gdata2 !== void 0 && _gdata2.xp && (_gdata3 = gdata[m + 1]) !== null && _gdata3 !== void 0 && _gdata3.xp && curXpInterval > 0) {
|
|
42113
|
-
var leftXp = xp - gdata[m - 1].xp;
|
|
42136
|
+
var leftXp = Math.abs(xp - gdata[m - 1].xp);
|
|
42114
42137
|
var midXp = Math.abs(xp - gdata[m].xp);
|
|
42115
|
-
var rightXp = gdata[m + 1].xp - xp;
|
|
42138
|
+
var rightXp = Math.abs(gdata[m + 1].xp - xp);
|
|
42116
42139
|
|
|
42117
42140
|
if (Math.abs(this.beforeMouseXp - xp) >= curXpInterval - SPARE_XP && (this.beforeFindItemIndex === m || midXp === rightXp || midXp === leftXp)) {
|
|
42118
42141
|
if (this.beforeMouseXp - xp > 0) {
|
|
@@ -42438,13 +42461,23 @@ var element_scatter_Scatter = /*#__PURE__*/function () {
|
|
|
42438
42461
|
var ctx = param.ctx,
|
|
42439
42462
|
axesSteps = param.axesSteps,
|
|
42440
42463
|
duple = param.duple,
|
|
42441
|
-
legendHitInfo = param.legendHitInfo
|
|
42464
|
+
legendHitInfo = param.legendHitInfo,
|
|
42465
|
+
coordinateDedupe = param.coordinateDedupe;
|
|
42442
42466
|
var minmaxY = axesSteps.y[this.yAxisIndex]; // Adjusted because Real Time Scatter is drawn from the back.
|
|
42443
42467
|
|
|
42444
42468
|
for (var i = 0; i < this.data.length; i++) {
|
|
42445
42469
|
var item = this.data[i];
|
|
42446
42470
|
var idx = i;
|
|
42447
|
-
var
|
|
42471
|
+
var isDedupeOn = coordinateDedupe !== false;
|
|
42472
|
+
var shouldDraw = void 0;
|
|
42473
|
+
|
|
42474
|
+
if (legendHitInfo) {
|
|
42475
|
+
shouldDraw = legendHitInfo.sId === this.sId;
|
|
42476
|
+
} else if (isDedupeOn) {
|
|
42477
|
+
shouldDraw = duple.get("".concat(item.x).concat(item.y)) === this.sId;
|
|
42478
|
+
} else {
|
|
42479
|
+
shouldDraw = true;
|
|
42480
|
+
}
|
|
42448
42481
|
|
|
42449
42482
|
if (shouldDraw) {
|
|
42450
42483
|
this.calcItem(item, param);
|
|
@@ -42473,7 +42506,8 @@ var element_scatter_Scatter = /*#__PURE__*/function () {
|
|
|
42473
42506
|
var ctx = param.ctx,
|
|
42474
42507
|
axesSteps = param.axesSteps,
|
|
42475
42508
|
duple = param.duple,
|
|
42476
|
-
legendHitInfo = param.legendHitInfo
|
|
42509
|
+
legendHitInfo = param.legendHitInfo,
|
|
42510
|
+
coordinateDedupe = param.coordinateDedupe;
|
|
42477
42511
|
var minmaxY = axesSteps.y[this.yAxisIndex];
|
|
42478
42512
|
var pointStyle = typeof this.pointStyle === 'string' ? this.pointStyle : this.pointStyle.value;
|
|
42479
42513
|
var pointSize = typeof this.pointSize === 'number' ? this.pointSize : this.pointSize.value;
|
|
@@ -42485,7 +42519,16 @@ var element_scatter_Scatter = /*#__PURE__*/function () {
|
|
|
42485
42519
|
var _this$data$this$sId2, _this$data$this$sId2$, _this$data$this$sId3, _this$data$this$sId3$;
|
|
42486
42520
|
|
|
42487
42521
|
var item = (_this$data$this$sId3 = this.data[this.sId]) === null || _this$data$this$sId3 === void 0 ? void 0 : (_this$data$this$sId3$ = _this$data$this$sId3.dataGroup[i]) === null || _this$data$this$sId3$ === void 0 ? void 0 : _this$data$this$sId3$.data[j];
|
|
42488
|
-
var
|
|
42522
|
+
var isDedupeOnRT = coordinateDedupe !== false;
|
|
42523
|
+
var shouldDraw = void 0;
|
|
42524
|
+
|
|
42525
|
+
if (legendHitInfo) {
|
|
42526
|
+
shouldDraw = legendHitInfo.sId === this.sId;
|
|
42527
|
+
} else if (isDedupeOnRT) {
|
|
42528
|
+
shouldDraw = duple.get("".concat(item.x).concat(item.y)) === this.sId;
|
|
42529
|
+
} else {
|
|
42530
|
+
shouldDraw = true;
|
|
42531
|
+
}
|
|
42489
42532
|
|
|
42490
42533
|
if (shouldDraw) {
|
|
42491
42534
|
this.calcItem(item, param);
|
|
@@ -42740,8 +42783,12 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42740
42783
|
|
|
42741
42784
|
var xArea = chartRect.chartWidth - (labelOffset.left + labelOffset.right);
|
|
42742
42785
|
var yArea = chartRect.chartHeight - (labelOffset.top + labelOffset.bottom);
|
|
42743
|
-
var
|
|
42744
|
-
var
|
|
42786
|
+
var xAxisPosition = chartRect.x1 + labelOffset.left;
|
|
42787
|
+
var yAxisPosition = chartRect.y2 - labelOffset.bottom;
|
|
42788
|
+
var xZeroPosition = helpers_canvas.calculateX(0, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42789
|
+
var yZeroPosition = helpers_canvas.calculateY(0, minmaxY.graphMin, minmaxY.graphMax, yArea);
|
|
42790
|
+
var xsp = isHorizontal ? xAxisPosition + xZeroPosition : xAxisPosition;
|
|
42791
|
+
var ysp = isHorizontal ? yAxisPosition : yAxisPosition + yZeroPosition;
|
|
42745
42792
|
var dArea = isHorizontal ? yArea : xArea;
|
|
42746
42793
|
var cArea = dArea / (totalCount || 1);
|
|
42747
42794
|
var cPad;
|
|
@@ -42805,7 +42852,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42805
42852
|
categoryPoint = ysp - cArea * screenIndex - cPad;
|
|
42806
42853
|
} else {
|
|
42807
42854
|
categoryPoint = xsp + cArea * screenIndex + cPad;
|
|
42808
|
-
}
|
|
42855
|
+
} // 기본 위치 설정
|
|
42856
|
+
|
|
42809
42857
|
|
|
42810
42858
|
if (isHorizontal) {
|
|
42811
42859
|
x = xsp;
|
|
@@ -42813,22 +42861,30 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42813
42861
|
} else {
|
|
42814
42862
|
x = Math.round(categoryPoint + (bArea * barSeriesX - (w + bPad)));
|
|
42815
42863
|
y = ysp;
|
|
42816
|
-
}
|
|
42864
|
+
} // 너비 / 높이 계산, 스택의 경우 위치 값 재계산
|
|
42865
|
+
|
|
42817
42866
|
|
|
42818
42867
|
if (isHorizontal) {
|
|
42868
|
+
var barValue = item.b ? item.o : item.x;
|
|
42869
|
+
w = helpers_canvas.calculateX(barValue, minmaxX.graphMin, minmaxX.graphMax, xArea, -xZeroPosition);
|
|
42870
|
+
|
|
42819
42871
|
if (item.b) {
|
|
42820
|
-
|
|
42821
|
-
x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp);
|
|
42822
|
-
} else {
|
|
42823
|
-
w = helpers_canvas.calculateX(item.x, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42872
|
+
x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp - xZeroPosition);
|
|
42824
42873
|
}
|
|
42825
|
-
|
|
42826
|
-
|
|
42827
|
-
|
|
42828
|
-
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
42874
|
+
|
|
42875
|
+
var minimumBarWidth = barValue > 0 ? -1 : 1;
|
|
42876
|
+
w = barValue && Math.abs(w) === 0 ? minimumBarWidth : w;
|
|
42829
42877
|
} else {
|
|
42830
|
-
|
|
42831
|
-
|
|
42878
|
+
var _barValue = item.b ? item.o : item.y;
|
|
42879
|
+
|
|
42880
|
+
h = helpers_canvas.calculateY(_barValue, minmaxY.graphMin, minmaxY.graphMax, yArea, -yZeroPosition);
|
|
42881
|
+
|
|
42882
|
+
if (item.b) {
|
|
42883
|
+
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp - yZeroPosition);
|
|
42884
|
+
}
|
|
42885
|
+
|
|
42886
|
+
var minimumBarHeight = _barValue > 0 ? -1 : 1;
|
|
42887
|
+
h = _barValue && Math.abs(h) === 0 ? minimumBarHeight : h;
|
|
42832
42888
|
}
|
|
42833
42889
|
|
|
42834
42890
|
var barColor = item.dataColor || this.color;
|
|
@@ -43117,10 +43173,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43117
43173
|
align = _this$showValue.align,
|
|
43118
43174
|
formatter = _this$showValue.formatter,
|
|
43119
43175
|
decimalPoint = _this$showValue.decimalPoint;
|
|
43120
|
-
var
|
|
43121
|
-
|
|
43122
|
-
|
|
43123
|
-
|
|
43176
|
+
var barX = positions.x,
|
|
43177
|
+
barY = positions.y,
|
|
43178
|
+
barWidth = positions.w,
|
|
43179
|
+
barHeight = positions.h;
|
|
43124
43180
|
var ctx = context;
|
|
43125
43181
|
ctx.save();
|
|
43126
43182
|
ctx.beginPath();
|
|
@@ -43155,25 +43211,27 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43155
43211
|
formattedTxt = (_Util$labelSignFormat = helpers_util.labelSignFormat(value, decimalPoint)) !== null && _Util$labelSignFormat !== void 0 ? _Util$labelSignFormat : '';
|
|
43156
43212
|
}
|
|
43157
43213
|
|
|
43214
|
+
var isNegativeValue = value < 0;
|
|
43158
43215
|
var textWidth = Math.round(ctx.measureText(formattedTxt).width);
|
|
43159
|
-
var textHeight = fontSize
|
|
43160
|
-
|
|
43161
|
-
var
|
|
43162
|
-
var
|
|
43163
|
-
var
|
|
43164
|
-
var
|
|
43165
|
-
var
|
|
43166
|
-
var
|
|
43216
|
+
var textHeight = fontSize; // fontSize와 textHeight는 같을 수 없지만, 정확히 구할 필요 없음
|
|
43217
|
+
|
|
43218
|
+
var GAP = 10;
|
|
43219
|
+
var minXPos = isNegativeValue ? barX - GAP : barX + GAP;
|
|
43220
|
+
var minYPos = isNegativeValue ? barY + GAP : barY - GAP;
|
|
43221
|
+
var centerXOnBar = barX + barWidth / 2;
|
|
43222
|
+
var centerYOnBar = isHighlight ? barY + barHeight / 2 : barY - barHeight / 2;
|
|
43223
|
+
var drawableBarWidth = Math.abs(barWidth) - GAP;
|
|
43224
|
+
var drawableBarHeight = Math.abs(barHeight) - GAP;
|
|
43167
43225
|
|
|
43168
43226
|
switch (align) {
|
|
43169
43227
|
case 'start':
|
|
43170
43228
|
{
|
|
43171
|
-
if (isHorizontal) {
|
|
43172
|
-
|
|
43173
|
-
|
|
43174
|
-
|
|
43175
|
-
|
|
43176
|
-
ctx.fillText(formattedTxt,
|
|
43229
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43230
|
+
var xPos = isNegativeValue ? minXPos - textWidth : minXPos;
|
|
43231
|
+
ctx.fillText(formattedTxt, xPos, centerYOnBar);
|
|
43232
|
+
} else if (!isHorizontal && textHeight < drawableBarHeight) {
|
|
43233
|
+
var yPos = isNegativeValue ? barY + GAP : barY - GAP;
|
|
43234
|
+
ctx.fillText(formattedTxt, centerXOnBar, yPos);
|
|
43177
43235
|
}
|
|
43178
43236
|
|
|
43179
43237
|
break;
|
|
@@ -43181,12 +43239,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43181
43239
|
|
|
43182
43240
|
case 'center':
|
|
43183
43241
|
{
|
|
43184
|
-
if (isHorizontal) {
|
|
43185
|
-
|
|
43186
|
-
|
|
43187
|
-
|
|
43188
|
-
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43189
|
-
ctx.fillText(formattedTxt, centerX, centerY);
|
|
43242
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43243
|
+
ctx.fillText(formattedTxt, centerXOnBar, centerYOnBar);
|
|
43244
|
+
} else if (!isHorizontal && textHeight < drawableBarHeight) {
|
|
43245
|
+
ctx.fillText(formattedTxt, centerXOnBar, barY + barHeight / 2);
|
|
43190
43246
|
}
|
|
43191
43247
|
|
|
43192
43248
|
break;
|
|
@@ -43200,9 +43256,26 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43200
43256
|
}
|
|
43201
43257
|
|
|
43202
43258
|
if (isHorizontal) {
|
|
43203
|
-
|
|
43259
|
+
var minXOnChart = this.chartRect.x1 + this.labelOffset.left;
|
|
43260
|
+
var maxXOnChart = this.chartRect.x2 - this.labelOffset.right;
|
|
43261
|
+
|
|
43262
|
+
if (isNegativeValue) {
|
|
43263
|
+
var _xPos = barX - GAP + barWidth - textWidth;
|
|
43264
|
+
|
|
43265
|
+
if (_xPos > minXOnChart) {
|
|
43266
|
+
ctx.fillText(formattedTxt, _xPos, centerYOnBar);
|
|
43267
|
+
}
|
|
43268
|
+
} else {
|
|
43269
|
+
var _xPos2 = barX + GAP + barWidth;
|
|
43270
|
+
|
|
43271
|
+
if (_xPos2 + textWidth < maxXOnChart) {
|
|
43272
|
+
ctx.fillText(formattedTxt, _xPos2, centerYOnBar);
|
|
43273
|
+
}
|
|
43274
|
+
}
|
|
43204
43275
|
} else {
|
|
43205
|
-
|
|
43276
|
+
var _yPos = isNegativeValue ? barY + barHeight + GAP : barY + barHeight - GAP;
|
|
43277
|
+
|
|
43278
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos);
|
|
43206
43279
|
}
|
|
43207
43280
|
|
|
43208
43281
|
break;
|
|
@@ -43211,14 +43284,22 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43211
43284
|
default:
|
|
43212
43285
|
case 'end':
|
|
43213
43286
|
{
|
|
43214
|
-
if (isHorizontal) {
|
|
43215
|
-
|
|
43216
|
-
|
|
43217
|
-
|
|
43287
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43288
|
+
var _xPos3 = isNegativeValue ? barX + barWidth + GAP : barX + barWidth - textWidth - GAP;
|
|
43289
|
+
|
|
43290
|
+
ctx.fillText(formattedTxt, _xPos3, centerYOnBar);
|
|
43291
|
+
} else if (!isHorizontal) {
|
|
43292
|
+
if (isNegativeValue) {
|
|
43293
|
+
var _yPos2 = barY + barHeight - GAP;
|
|
43294
|
+
|
|
43295
|
+
if (_yPos2 > minYPos) {
|
|
43296
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos2);
|
|
43297
|
+
}
|
|
43298
|
+
} else if (textHeight < drawableBarHeight) {
|
|
43299
|
+
var _yPos3 = barY + barHeight + GAP;
|
|
43300
|
+
|
|
43301
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos3);
|
|
43218
43302
|
}
|
|
43219
|
-
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43220
|
-
var yPos = y + h + textHeight;
|
|
43221
|
-
ctx.fillText(formattedTxt, centerX, yPos >= minYPos ? minYPos : yPos);
|
|
43222
43303
|
}
|
|
43223
43304
|
|
|
43224
43305
|
break;
|
|
@@ -43275,28 +43356,50 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43275
43356
|
ctx.beginPath();
|
|
43276
43357
|
ctx.moveTo(x, y);
|
|
43277
43358
|
|
|
43359
|
+
if (Math.abs(w) < r * 2) {
|
|
43360
|
+
r = Math.abs(w) / 2;
|
|
43361
|
+
}
|
|
43362
|
+
|
|
43363
|
+
if (Math.abs(h) < r * 2) {
|
|
43364
|
+
r = Math.abs(h) / 2;
|
|
43365
|
+
}
|
|
43366
|
+
|
|
43278
43367
|
if (isHorizontal) {
|
|
43279
|
-
|
|
43280
|
-
|
|
43368
|
+
var isNegativeValue = w < 0;
|
|
43369
|
+
|
|
43370
|
+
if (isNegativeValue) {
|
|
43371
|
+
w += r;
|
|
43372
|
+
ctx.lineTo(x + w, y);
|
|
43373
|
+
ctx.arcTo(x + w - r, y, x + w - r, y - r, r);
|
|
43374
|
+
ctx.arcTo(x + w - r, y - h, x + w, y - h, r);
|
|
43375
|
+
ctx.lineTo(x, y - h);
|
|
43376
|
+
ctx.lineTo(x, y);
|
|
43377
|
+
} else {
|
|
43378
|
+
w -= r;
|
|
43379
|
+
ctx.lineTo(x + w, y);
|
|
43380
|
+
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43381
|
+
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43382
|
+
ctx.lineTo(x, y - h);
|
|
43383
|
+
ctx.lineTo(x, y);
|
|
43281
43384
|
}
|
|
43282
|
-
|
|
43283
|
-
w -= r;
|
|
43284
|
-
ctx.lineTo(x + w, y);
|
|
43285
|
-
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43286
|
-
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43287
|
-
ctx.lineTo(x, y - h);
|
|
43288
|
-
ctx.lineTo(x, y);
|
|
43289
43385
|
} else {
|
|
43290
|
-
|
|
43291
|
-
|
|
43386
|
+
var _isNegativeValue = h > 0;
|
|
43387
|
+
|
|
43388
|
+
if (_isNegativeValue) {
|
|
43389
|
+
h -= r;
|
|
43390
|
+
ctx.lineTo(x + w, y);
|
|
43391
|
+
ctx.lineTo(x + w, y + h);
|
|
43392
|
+
ctx.arcTo(x + w, y + h + r, x - w + r, y + h + r, r);
|
|
43393
|
+
ctx.arcTo(x, y + h + r, x, y + h, r);
|
|
43394
|
+
ctx.lineTo(x, y);
|
|
43395
|
+
} else {
|
|
43396
|
+
h += r;
|
|
43397
|
+
ctx.lineTo(x + w, y);
|
|
43398
|
+
ctx.lineTo(x + w, y + h);
|
|
43399
|
+
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43400
|
+
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43401
|
+
ctx.lineTo(x, y);
|
|
43292
43402
|
}
|
|
43293
|
-
|
|
43294
|
-
h += r;
|
|
43295
|
-
ctx.lineTo(x + w, y);
|
|
43296
|
-
ctx.lineTo(x + w, y + h);
|
|
43297
|
-
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43298
|
-
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43299
|
-
ctx.lineTo(x, y);
|
|
43300
43403
|
}
|
|
43301
43404
|
|
|
43302
43405
|
ctx.fill();
|
|
@@ -45051,6 +45154,7 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45051
45154
|
}
|
|
45052
45155
|
/**
|
|
45053
45156
|
* With range information, calculate how many labels in axis
|
|
45157
|
+
* linear type은 scale.linear.js에서 처리
|
|
45054
45158
|
* @param {object} range min/max information
|
|
45055
45159
|
*
|
|
45056
45160
|
* @returns {object} steps, interval, min/max graph value
|
|
@@ -45259,6 +45363,14 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45259
45363
|
|
|
45260
45364
|
ctx.beginPath();
|
|
45261
45365
|
ticks[ix] = axisMinForLabel + ix * stepValue;
|
|
45366
|
+
var isZeroLine = ticks[ix] === 0;
|
|
45367
|
+
|
|
45368
|
+
if (isZeroLine && _this3.zeroLineColor) {
|
|
45369
|
+
ctx.strokeStyle = _this3.zeroLineColor;
|
|
45370
|
+
} else {
|
|
45371
|
+
ctx.strokeStyle = _this3.gridLineColor;
|
|
45372
|
+
}
|
|
45373
|
+
|
|
45262
45374
|
linePosition = labelCenter + aliasPixel;
|
|
45263
45375
|
labelText = _this3.getLabelFormat(Math.min(axisMax, ticks[ix]), {
|
|
45264
45376
|
prev: (_ticks = ticks[ix - 1]) !== null && _ticks !== void 0 ? _ticks : ''
|
|
@@ -45364,9 +45476,11 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45364
45476
|
}
|
|
45365
45477
|
|
|
45366
45478
|
var mergedPlotBandOpt = lodash_es_defaultsDeep({}, plotBand, PLOT_BAND_OPTION);
|
|
45367
|
-
var
|
|
45368
|
-
|
|
45479
|
+
var userDefinedFrom = mergedPlotBandOpt.from,
|
|
45480
|
+
userDefinedTo = mergedPlotBandOpt.to,
|
|
45369
45481
|
labelOpt = mergedPlotBandOpt.label;
|
|
45482
|
+
var from = userDefinedFrom ? Math.max(userDefinedFrom, axisMin) : axisMin;
|
|
45483
|
+
var to = userDefinedTo ? Math.min(userDefinedTo, axisMax) : axisMax;
|
|
45370
45484
|
|
|
45371
45485
|
_this3.setPlotBandStyle(mergedPlotBandOpt);
|
|
45372
45486
|
|
|
@@ -45374,8 +45488,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45374
45488
|
var toPos;
|
|
45375
45489
|
|
|
45376
45490
|
if (_this3.type === 'x') {
|
|
45377
|
-
fromPos = helpers_canvas.calculateX(from
|
|
45378
|
-
toPos = helpers_canvas.calculateX(to
|
|
45491
|
+
fromPos = helpers_canvas.calculateX(from, axisMin, axisMax, xArea, minX);
|
|
45492
|
+
toPos = helpers_canvas.calculateX(to, axisMin, axisMax, xArea, minX);
|
|
45379
45493
|
|
|
45380
45494
|
if (fromPos === null || toPos === null) {
|
|
45381
45495
|
return;
|
|
@@ -45383,8 +45497,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45383
45497
|
|
|
45384
45498
|
_this3.drawXPlotBand(fromPos, toPos, minX, maxX, minY, maxY);
|
|
45385
45499
|
} else {
|
|
45386
|
-
fromPos = helpers_canvas.calculateY(from
|
|
45387
|
-
toPos = helpers_canvas.calculateY(to
|
|
45500
|
+
fromPos = helpers_canvas.calculateY(from, axisMin, axisMax, yArea, maxY);
|
|
45501
|
+
toPos = helpers_canvas.calculateY(to, axisMin, axisMax, yArea, maxY);
|
|
45388
45502
|
|
|
45389
45503
|
if (fromPos === null || toPos === null) {
|
|
45390
45504
|
return;
|
|
@@ -45955,6 +46069,7 @@ var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
|
|
|
45955
46069
|
|
|
45956
46070
|
|
|
45957
46071
|
|
|
46072
|
+
|
|
45958
46073
|
var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
45959
46074
|
_inherits(LinearScale, _Scale);
|
|
45960
46075
|
|
|
@@ -45993,16 +46108,192 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
|
45993
46108
|
* Calculate interval
|
|
45994
46109
|
* @param {object} range range information
|
|
45995
46110
|
*
|
|
45996
|
-
* @returns {number}
|
|
46111
|
+
* @returns {number} interval (한 칸에 표시할 값의 간격)
|
|
45997
46112
|
*/
|
|
45998
46113
|
|
|
45999
46114
|
}, {
|
|
46000
46115
|
key: "getInterval",
|
|
46001
46116
|
value: function getInterval(range) {
|
|
46117
|
+
if (this.interval) return this.interval;
|
|
46002
46118
|
var max = range.maxValue;
|
|
46003
46119
|
var min = range.minValue;
|
|
46004
|
-
var
|
|
46005
|
-
|
|
46120
|
+
var steps = range.maxSteps; // step이 0이면 interval 계산 불가
|
|
46121
|
+
|
|
46122
|
+
if (!steps || steps <= 0) return 0; // startToZero이고, 최소값이 음수일 경우 0을 반드시 포함
|
|
46123
|
+
|
|
46124
|
+
if (this.startToZero && min < 0) {
|
|
46125
|
+
var totalRange = Math.abs(min) + Math.abs(max); // 비율로 나눔
|
|
46126
|
+
|
|
46127
|
+
var negativeRatio = Math.abs(min) / totalRange;
|
|
46128
|
+
var positiveRatio = Math.abs(max) / totalRange; // 각 방향에 최소 1칸 이상 배정되도록 보장
|
|
46129
|
+
|
|
46130
|
+
var negativeSteps = Math.max(1, Math.round(negativeRatio * steps));
|
|
46131
|
+
var positiveSteps = Math.max(1, steps - negativeSteps); // 다시 합이 steps보다 커질 수도 있으니, 조정
|
|
46132
|
+
|
|
46133
|
+
if (negativeSteps + positiveSteps > steps) {
|
|
46134
|
+
// 가장 큰 쪽에서 하나 줄임
|
|
46135
|
+
if (negativeRatio > positiveRatio) {
|
|
46136
|
+
negativeSteps -= 1;
|
|
46137
|
+
} else {
|
|
46138
|
+
positiveSteps -= 1;
|
|
46139
|
+
}
|
|
46140
|
+
}
|
|
46141
|
+
|
|
46142
|
+
return Math.ceil(Math.max(Math.abs(min) / (negativeSteps || 1), Math.abs(max) / (positiveSteps || 1)));
|
|
46143
|
+
}
|
|
46144
|
+
|
|
46145
|
+
return Math.ceil((max - min) / steps);
|
|
46146
|
+
}
|
|
46147
|
+
/**
|
|
46148
|
+
* With range information, calculate how many labels in axis
|
|
46149
|
+
* @param {object} range min/max information
|
|
46150
|
+
*
|
|
46151
|
+
* @returns {object} steps, interval, min/max graph value
|
|
46152
|
+
*/
|
|
46153
|
+
|
|
46154
|
+
}, {
|
|
46155
|
+
key: "calculateSteps",
|
|
46156
|
+
value: function calculateSteps(range) {
|
|
46157
|
+
var maxValue = range.maxValue,
|
|
46158
|
+
minValue = range.minValue;
|
|
46159
|
+
var _range$maxSteps = range.maxSteps,
|
|
46160
|
+
maxSteps = _range$maxSteps === void 0 ? 1 : _range$maxSteps;
|
|
46161
|
+
var interval = this.getInterval(range);
|
|
46162
|
+
var graphMin = 0;
|
|
46163
|
+
var graphMax = 0; // 그래프 최대/최소 값 계산
|
|
46164
|
+
|
|
46165
|
+
if (minValue >= 0) {
|
|
46166
|
+
// 전부 양수
|
|
46167
|
+
graphMin = +minValue;
|
|
46168
|
+
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46169
|
+
} else if (maxValue >= 0) {
|
|
46170
|
+
// 양수/음수 혼합
|
|
46171
|
+
graphMin = Math.floor(minValue / interval) * interval;
|
|
46172
|
+
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46173
|
+
} else {
|
|
46174
|
+
// 전부 음수
|
|
46175
|
+
graphMax = +maxValue;
|
|
46176
|
+
graphMin = Math.floor(minValue / interval) * interval;
|
|
46177
|
+
}
|
|
46178
|
+
|
|
46179
|
+
var graphRange = graphMax - graphMin;
|
|
46180
|
+
var numberOfSteps = Math.round(graphRange / interval); // 특수 케이스: 양수 최소값, 최대값이 1일 경우
|
|
46181
|
+
|
|
46182
|
+
if (minValue > 0 && maxValue === 1) {
|
|
46183
|
+
if (!this.decimalPoint) {
|
|
46184
|
+
interval = 1;
|
|
46185
|
+
numberOfSteps = 1;
|
|
46186
|
+
maxSteps = 1;
|
|
46187
|
+
} else if (maxSteps > 2) {
|
|
46188
|
+
interval = 0.2;
|
|
46189
|
+
numberOfSteps = 5;
|
|
46190
|
+
maxSteps = 5;
|
|
46191
|
+
} else {
|
|
46192
|
+
interval = 0.5;
|
|
46193
|
+
numberOfSteps = 2;
|
|
46194
|
+
maxSteps = 2;
|
|
46195
|
+
}
|
|
46196
|
+
} // 최대 스텝 수 조정
|
|
46197
|
+
|
|
46198
|
+
|
|
46199
|
+
while (numberOfSteps > maxSteps) {
|
|
46200
|
+
interval *= 2;
|
|
46201
|
+
numberOfSteps = Math.round(graphRange / interval);
|
|
46202
|
+
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46203
|
+
}
|
|
46204
|
+
|
|
46205
|
+
if (graphRange > numberOfSteps * interval) {
|
|
46206
|
+
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46207
|
+
}
|
|
46208
|
+
|
|
46209
|
+
return {
|
|
46210
|
+
steps: numberOfSteps,
|
|
46211
|
+
interval: interval,
|
|
46212
|
+
graphMin: graphMin,
|
|
46213
|
+
graphMax: graphMax
|
|
46214
|
+
};
|
|
46215
|
+
}
|
|
46216
|
+
/**
|
|
46217
|
+
* Calculate min/max value, label and size information for axis
|
|
46218
|
+
* @param {object} minMax min/max information
|
|
46219
|
+
* @param {object} scrollbarOpt scrollbar option
|
|
46220
|
+
*
|
|
46221
|
+
* @returns {object} min/max value and label
|
|
46222
|
+
*/
|
|
46223
|
+
|
|
46224
|
+
}, {
|
|
46225
|
+
key: "calculateScaleRange",
|
|
46226
|
+
value: function calculateScaleRange(minMax, scrollbarOpt) {
|
|
46227
|
+
var _this$labelStyle;
|
|
46228
|
+
|
|
46229
|
+
var maxValue;
|
|
46230
|
+
var minValue;
|
|
46231
|
+
var isDefaultMaxSameAsMin = false;
|
|
46232
|
+
var range = scrollbarOpt !== null && scrollbarOpt !== void 0 && scrollbarOpt.use ? scrollbarOpt === null || scrollbarOpt === void 0 ? void 0 : scrollbarOpt.range : this.range;
|
|
46233
|
+
|
|
46234
|
+
if (Array.isArray(range) && (range === null || range === void 0 ? void 0 : range.length) === 2) {
|
|
46235
|
+
if (this.options.type === 'heatMap') {
|
|
46236
|
+
maxValue = range[1] > +minMax.max ? +minMax.max : range[1];
|
|
46237
|
+
minValue = range[0] < +minMax.min ? +minMax.min : range[0];
|
|
46238
|
+
} else {
|
|
46239
|
+
maxValue = range[1];
|
|
46240
|
+
minValue = range[0];
|
|
46241
|
+
}
|
|
46242
|
+
} else if (typeof range === 'function') {
|
|
46243
|
+
var _range = range(minMax.min, minMax.max);
|
|
46244
|
+
|
|
46245
|
+
var _range2 = _slicedToArray(_range, 2);
|
|
46246
|
+
|
|
46247
|
+
minValue = _range2[0];
|
|
46248
|
+
maxValue = _range2[1];
|
|
46249
|
+
} else {
|
|
46250
|
+
maxValue = minMax.max;
|
|
46251
|
+
minValue = minMax.min;
|
|
46252
|
+
} // autoScaleRatio 적용 케이스
|
|
46253
|
+
|
|
46254
|
+
|
|
46255
|
+
if (this.autoScaleRatio) {
|
|
46256
|
+
var temp = maxValue; // 양수 방향에만 autoScaleRatio 적용
|
|
46257
|
+
|
|
46258
|
+
maxValue = Math.ceil(maxValue * (this.autoScaleRatio + 1));
|
|
46259
|
+
|
|
46260
|
+
if (maxValue > 0 && minValue < 0) {
|
|
46261
|
+
// 양수/음수 혼합 케이스 -- 음수 방향에도 maxValue 증가분만큼 더하기
|
|
46262
|
+
var diff = temp - maxValue;
|
|
46263
|
+
minValue += diff;
|
|
46264
|
+
} else if (maxValue < 0 && minValue < 0) {
|
|
46265
|
+
// 전부 음수 케이스 -- 음수 방향에도 autoScaleRatio 적용
|
|
46266
|
+
minValue = Math.ceil(minValue * (this.autoScaleRatio + 1));
|
|
46267
|
+
}
|
|
46268
|
+
} // 0 기준 축 설정 케이스
|
|
46269
|
+
|
|
46270
|
+
|
|
46271
|
+
if (this.startToZero) {
|
|
46272
|
+
if (minValue > 0) {
|
|
46273
|
+
minValue = 0;
|
|
46274
|
+
}
|
|
46275
|
+
|
|
46276
|
+
if (maxValue < 0) {
|
|
46277
|
+
maxValue = 0;
|
|
46278
|
+
}
|
|
46279
|
+
}
|
|
46280
|
+
|
|
46281
|
+
if (maxValue === minValue) {
|
|
46282
|
+
maxValue += 1;
|
|
46283
|
+
isDefaultMaxSameAsMin = true;
|
|
46284
|
+
}
|
|
46285
|
+
|
|
46286
|
+
var minLabel = this.getLabelFormat(minValue);
|
|
46287
|
+
var maxLabel = this.getLabelFormat(maxValue, {
|
|
46288
|
+
isMaxValueSameAsMin: isDefaultMaxSameAsMin
|
|
46289
|
+
});
|
|
46290
|
+
return {
|
|
46291
|
+
min: minValue,
|
|
46292
|
+
max: maxValue,
|
|
46293
|
+
minLabel: minLabel,
|
|
46294
|
+
maxLabel: maxLabel,
|
|
46295
|
+
size: helpers_util.calcTextSize(maxLabel, helpers_util.getLabelStyle(this.labelStyle), (_this$labelStyle = this.labelStyle) === null || _this$labelStyle === void 0 ? void 0 : _this$labelStyle.padding)
|
|
46296
|
+
};
|
|
46006
46297
|
}
|
|
46007
46298
|
}]);
|
|
46008
46299
|
|
|
@@ -47232,7 +47523,7 @@ var plugins_legend_modules = {
|
|
|
47232
47523
|
var useLegendSeries = [];
|
|
47233
47524
|
|
|
47234
47525
|
if (groups) {
|
|
47235
|
-
useLegendSeries = groups.
|
|
47526
|
+
useLegendSeries = groups.filter(function (sId) {
|
|
47236
47527
|
return _this3.seriesList[sId].showLegend;
|
|
47237
47528
|
}).map(function (sId) {
|
|
47238
47529
|
return [sId, _this3.seriesList[sId]];
|
|
@@ -47283,9 +47574,8 @@ var plugins_legend_modules = {
|
|
|
47283
47574
|
},
|
|
47284
47575
|
|
|
47285
47576
|
/**
|
|
47286
|
-
* Adds legends for each group in `groups` array, iterating through each series
|
|
47287
|
-
*
|
|
47288
|
-
* order as displayed in the chart. Only adds series with `showLegend` set to `true`.
|
|
47577
|
+
* Adds legends for each group in `groups` array, iterating through each series within the group.
|
|
47578
|
+
* Only adds series with `showLegend` set to `true`.
|
|
47289
47579
|
*
|
|
47290
47580
|
* @param {Array} groups - Array of groups containing series identifiers.
|
|
47291
47581
|
* @param {Object} seriesList - Object containing all series, keyed by series ID.
|
|
@@ -47296,7 +47586,7 @@ var plugins_legend_modules = {
|
|
|
47296
47586
|
var _this5 = this;
|
|
47297
47587
|
|
|
47298
47588
|
groups.forEach(function (group) {
|
|
47299
|
-
group.
|
|
47589
|
+
group.forEach(function (sId) {
|
|
47300
47590
|
var series = seriesList[sId];
|
|
47301
47591
|
|
|
47302
47592
|
if (series && series.showLegend) {
|
|
@@ -50438,6 +50728,15 @@ function inRange(number, start, end) {
|
|
|
50438
50728
|
|
|
50439
50729
|
|
|
50440
50730
|
|
|
50731
|
+
|
|
50732
|
+
|
|
50733
|
+
|
|
50734
|
+
|
|
50735
|
+
|
|
50736
|
+
|
|
50737
|
+
|
|
50738
|
+
|
|
50739
|
+
|
|
50441
50740
|
|
|
50442
50741
|
|
|
50443
50742
|
|
|
@@ -50544,14 +50843,30 @@ var plugins_interaction_modules = {
|
|
|
50544
50843
|
}
|
|
50545
50844
|
|
|
50546
50845
|
if (indicator.use && type !== 'pie' && type !== 'scatter' && type !== 'heatMap') {
|
|
50547
|
-
|
|
50846
|
+
// Use data point position instead of mouse position for indicator when tooltip is enabled
|
|
50847
|
+
var indicatorOffset = offset;
|
|
50548
50848
|
|
|
50549
50849
|
var label = _this.getTimeLabel(offset);
|
|
50550
50850
|
|
|
50851
|
+
var useAxisTrigger = tooltip.use && tooltip.trigger === 'axis' && type === 'line';
|
|
50852
|
+
|
|
50853
|
+
if (useAxisTrigger && Object.keys(hitInfo.items).length) {
|
|
50854
|
+
var hitId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
|
|
50855
|
+
var hitItem = hitInfo.items[hitId];
|
|
50856
|
+
|
|
50857
|
+
if (hitItem && hitItem.data && hitItem.data.xp !== undefined && hitItem.data.yp !== undefined) {
|
|
50858
|
+
indicatorOffset = [hitItem.data.xp, hitItem.data.yp];
|
|
50859
|
+
label = _this.data.labels[hitItem.index];
|
|
50860
|
+
}
|
|
50861
|
+
}
|
|
50862
|
+
|
|
50863
|
+
_this.drawIndicator(indicatorOffset, indicator.color);
|
|
50864
|
+
|
|
50551
50865
|
args.hoveredLabel = {
|
|
50552
50866
|
horizontal: _this.options.horizontal,
|
|
50553
50867
|
label: label,
|
|
50554
|
-
mousePosition: [e.clientX, e.clientY]
|
|
50868
|
+
mousePosition: [e.clientX, e.clientY],
|
|
50869
|
+
useAxisTrigger: useAxisTrigger
|
|
50555
50870
|
};
|
|
50556
50871
|
} else {
|
|
50557
50872
|
args.hoveredLabel = {
|
|
@@ -51411,17 +51726,59 @@ var plugins_interaction_modules = {
|
|
|
51411
51726
|
}
|
|
51412
51727
|
},
|
|
51413
51728
|
|
|
51729
|
+
/**
|
|
51730
|
+
* @typedef {object} HitInfo
|
|
51731
|
+
* @property {object} items
|
|
51732
|
+
* @property {string} hitId
|
|
51733
|
+
* @property {object} maxTip
|
|
51734
|
+
* @property {object} maxHighlight
|
|
51735
|
+
*/
|
|
51736
|
+
|
|
51414
51737
|
/**
|
|
51415
51738
|
* Find graph item on mouse position
|
|
51416
51739
|
* @param {array} offset return value from getMousePosition()
|
|
51417
51740
|
*
|
|
51418
|
-
* @returns {
|
|
51741
|
+
* @returns {HitInfo} hit item information
|
|
51419
51742
|
*/
|
|
51420
51743
|
findHitItem: function findHitItem(offset) {
|
|
51744
|
+
var _this4 = this;
|
|
51745
|
+
|
|
51421
51746
|
var sIds = Object.keys(this.seriesList);
|
|
51422
51747
|
var items = {};
|
|
51423
51748
|
var isHorizontal = !!this.options.horizontal;
|
|
51424
|
-
var ctx = this.tooltipCtx;
|
|
51749
|
+
var ctx = this.tooltipCtx; // Cache for measureText to avoid repeated calculations
|
|
51750
|
+
|
|
51751
|
+
if (!this._measureTextCache) {
|
|
51752
|
+
this._measureTextCache = new Map();
|
|
51753
|
+
} // Use sliding window cache based on text length to maintain frequently used entries
|
|
51754
|
+
|
|
51755
|
+
|
|
51756
|
+
if (this._measureTextCache.size > 1000) {
|
|
51757
|
+
var entries = Array.from(this._measureTextCache.entries()); // Sort by text length (shorter texts are likely more frequently used)
|
|
51758
|
+
|
|
51759
|
+
entries.sort(function (_ref2, _ref3) {
|
|
51760
|
+
var _ref4 = _slicedToArray(_ref2, 1),
|
|
51761
|
+
keyA = _ref4[0];
|
|
51762
|
+
|
|
51763
|
+
var _ref5 = _slicedToArray(_ref3, 1),
|
|
51764
|
+
keyB = _ref5[0];
|
|
51765
|
+
|
|
51766
|
+
var textA = keyA.split('-')[0];
|
|
51767
|
+
var textB = keyB.split('-')[0];
|
|
51768
|
+
return textA.length - textB.length;
|
|
51769
|
+
}); // Keep the first 500 entries (shorter texts)
|
|
51770
|
+
|
|
51771
|
+
this._measureTextCache.clear();
|
|
51772
|
+
|
|
51773
|
+
entries.slice(0, 500).forEach(function (_ref6) {
|
|
51774
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
51775
|
+
key = _ref7[0],
|
|
51776
|
+
value = _ref7[1];
|
|
51777
|
+
|
|
51778
|
+
_this4._measureTextCache.set(key, value);
|
|
51779
|
+
});
|
|
51780
|
+
}
|
|
51781
|
+
|
|
51425
51782
|
var hitId = null;
|
|
51426
51783
|
var maxs = '';
|
|
51427
51784
|
var maxsw = 0;
|
|
@@ -51431,64 +51788,81 @@ var plugins_interaction_modules = {
|
|
|
51431
51788
|
|
|
51432
51789
|
for (var ix = 0; ix < sIds.length; ix++) {
|
|
51433
51790
|
var sId = sIds[ix];
|
|
51434
|
-
var series = this.seriesList[sId];
|
|
51791
|
+
var series = this.seriesList[sId]; // Skip hidden series for performance
|
|
51435
51792
|
|
|
51436
|
-
if (series.findGraphData) {
|
|
51437
|
-
|
|
51793
|
+
if (!series.show || !series.findGraphData) {
|
|
51794
|
+
// eslint-disable-next-line no-continue
|
|
51795
|
+
continue;
|
|
51796
|
+
}
|
|
51438
51797
|
|
|
51439
|
-
|
|
51440
|
-
var gdata = void 0;
|
|
51798
|
+
var item = series.findGraphData(offset, isHorizontal);
|
|
51441
51799
|
|
|
51442
|
-
|
|
51443
|
-
|
|
51444
|
-
|
|
51445
|
-
|
|
51446
|
-
|
|
51447
|
-
gdata = item.data.
|
|
51800
|
+
if (item !== null && item !== void 0 && item.data) {
|
|
51801
|
+
var gdata = void 0;
|
|
51802
|
+
|
|
51803
|
+
if (item.data.o === null && series.interpolation !== 'zero') {
|
|
51804
|
+
if (!series.isExistGrp) {
|
|
51805
|
+
gdata = isHorizontal ? item.data.x : item.data.y;
|
|
51448
51806
|
}
|
|
51807
|
+
} else if (!isNaN(item.data.o)) {
|
|
51808
|
+
gdata = item.data.o;
|
|
51809
|
+
}
|
|
51449
51810
|
|
|
51450
|
-
|
|
51451
|
-
|
|
51452
|
-
|
|
51453
|
-
|
|
51454
|
-
|
|
51455
|
-
|
|
51456
|
-
|
|
51457
|
-
var sw = ctx ? ctx.measureText(formattedSeriesName).width : 1;
|
|
51458
|
-
item.id = series.id;
|
|
51459
|
-
item.name = formattedSeriesName;
|
|
51460
|
-
item.axis = {
|
|
51461
|
-
x: series.xAxisIndex,
|
|
51462
|
-
y: series.yAxisIndex
|
|
51463
|
-
};
|
|
51464
|
-
items[sId] = item;
|
|
51465
|
-
var formattedTxt = this.getFormattedTooltipValue({
|
|
51466
|
-
dataId: series.id,
|
|
51467
|
-
seriesId: sId,
|
|
51468
|
-
seriesName: formattedSeriesName,
|
|
51469
|
-
value: gdata,
|
|
51470
|
-
itemData: item.data
|
|
51471
|
-
});
|
|
51472
|
-
item.data.formatted = formattedTxt;
|
|
51811
|
+
if (gdata !== null && gdata !== undefined) {
|
|
51812
|
+
var formattedSeriesName = this.getFormattedTooltipLabel({
|
|
51813
|
+
dataId: series.id,
|
|
51814
|
+
seriesId: sId,
|
|
51815
|
+
seriesName: series.name,
|
|
51816
|
+
itemData: item.data
|
|
51817
|
+
}); // Use cached measureText for better performance
|
|
51473
51818
|
|
|
51474
|
-
|
|
51475
|
-
maxs = formattedSeriesName;
|
|
51476
|
-
maxsw = sw;
|
|
51477
|
-
}
|
|
51819
|
+
var sw = 1;
|
|
51478
51820
|
|
|
51479
|
-
|
|
51480
|
-
|
|
51481
|
-
}
|
|
51821
|
+
if (ctx) {
|
|
51822
|
+
var cacheKey = "".concat(formattedSeriesName, "-").concat(ctx.font);
|
|
51482
51823
|
|
|
51483
|
-
if (
|
|
51484
|
-
|
|
51485
|
-
|
|
51486
|
-
|
|
51824
|
+
if (this._measureTextCache.has(cacheKey)) {
|
|
51825
|
+
sw = this._measureTextCache.get(cacheKey);
|
|
51826
|
+
} else {
|
|
51827
|
+
sw = ctx.measureText(formattedSeriesName).width;
|
|
51487
51828
|
|
|
51488
|
-
|
|
51489
|
-
hitId = sId;
|
|
51829
|
+
this._measureTextCache.set(cacheKey, sw);
|
|
51490
51830
|
}
|
|
51491
51831
|
}
|
|
51832
|
+
|
|
51833
|
+
item.id = series.id;
|
|
51834
|
+
item.name = formattedSeriesName;
|
|
51835
|
+
item.axis = {
|
|
51836
|
+
x: series.xAxisIndex,
|
|
51837
|
+
y: series.yAxisIndex
|
|
51838
|
+
};
|
|
51839
|
+
items[sId] = item;
|
|
51840
|
+
var formattedTxt = this.getFormattedTooltipValue({
|
|
51841
|
+
dataId: series.id,
|
|
51842
|
+
seriesId: sId,
|
|
51843
|
+
seriesName: formattedSeriesName,
|
|
51844
|
+
value: gdata,
|
|
51845
|
+
itemData: item.data
|
|
51846
|
+
});
|
|
51847
|
+
item.data.formatted = formattedTxt;
|
|
51848
|
+
|
|
51849
|
+
if (maxsw < sw) {
|
|
51850
|
+
maxs = formattedSeriesName;
|
|
51851
|
+
maxsw = sw;
|
|
51852
|
+
}
|
|
51853
|
+
|
|
51854
|
+
if (maxv.length <= "".concat(formattedTxt).length) {
|
|
51855
|
+
maxv = "".concat(formattedTxt);
|
|
51856
|
+
}
|
|
51857
|
+
|
|
51858
|
+
if (maxg === null || maxg <= gdata) {
|
|
51859
|
+
maxg = gdata;
|
|
51860
|
+
maxSID = sId;
|
|
51861
|
+
}
|
|
51862
|
+
|
|
51863
|
+
if (item.hit) {
|
|
51864
|
+
hitId = sId;
|
|
51865
|
+
}
|
|
51492
51866
|
}
|
|
51493
51867
|
}
|
|
51494
51868
|
}
|
|
@@ -51511,13 +51885,13 @@ var plugins_interaction_modules = {
|
|
|
51511
51885
|
* @param itemData
|
|
51512
51886
|
* @returns {string}
|
|
51513
51887
|
*/
|
|
51514
|
-
getFormattedTooltipLabel: function getFormattedTooltipLabel(
|
|
51888
|
+
getFormattedTooltipLabel: function getFormattedTooltipLabel(_ref8) {
|
|
51515
51889
|
var _tooltipOpt$formatter;
|
|
51516
51890
|
|
|
51517
|
-
var dataId =
|
|
51518
|
-
seriesId =
|
|
51519
|
-
seriesName =
|
|
51520
|
-
itemData =
|
|
51891
|
+
var dataId = _ref8.dataId,
|
|
51892
|
+
seriesId = _ref8.seriesId,
|
|
51893
|
+
seriesName = _ref8.seriesName,
|
|
51894
|
+
itemData = _ref8.itemData;
|
|
51521
51895
|
var opt = this.options;
|
|
51522
51896
|
var tooltipOpt = opt.tooltip;
|
|
51523
51897
|
var tooltipLabelFormatter = tooltipOpt === null || tooltipOpt === void 0 ? void 0 : (_tooltipOpt$formatter = tooltipOpt.formatter) === null || _tooltipOpt$formatter === void 0 ? void 0 : _tooltipOpt$formatter.label;
|
|
@@ -51544,14 +51918,14 @@ var plugins_interaction_modules = {
|
|
|
51544
51918
|
* @param itemData
|
|
51545
51919
|
* @returns {string}
|
|
51546
51920
|
*/
|
|
51547
|
-
getFormattedTooltipValue: function getFormattedTooltipValue(
|
|
51921
|
+
getFormattedTooltipValue: function getFormattedTooltipValue(_ref9) {
|
|
51548
51922
|
var _tooltipOpt$formatter2;
|
|
51549
51923
|
|
|
51550
|
-
var dataId =
|
|
51551
|
-
seriesId =
|
|
51552
|
-
seriesName =
|
|
51553
|
-
value =
|
|
51554
|
-
itemData =
|
|
51924
|
+
var dataId = _ref9.dataId,
|
|
51925
|
+
seriesId = _ref9.seriesId,
|
|
51926
|
+
seriesName = _ref9.seriesName,
|
|
51927
|
+
value = _ref9.value,
|
|
51928
|
+
itemData = _ref9.itemData;
|
|
51555
51929
|
var opt = this.options;
|
|
51556
51930
|
var isHorizontal = !!opt.horizontal;
|
|
51557
51931
|
var tooltipOpt = opt.tooltip;
|
|
@@ -51724,7 +52098,7 @@ var plugins_interaction_modules = {
|
|
|
51724
52098
|
* @returns {object[]}
|
|
51725
52099
|
*/
|
|
51726
52100
|
getSelectedLabelInfoWithLabelData: function getSelectedLabelInfoWithLabelData(labelIndexList, targetAxis) {
|
|
51727
|
-
var
|
|
52101
|
+
var _this5 = this;
|
|
51728
52102
|
|
|
51729
52103
|
var _this$options9 = this.options,
|
|
51730
52104
|
selectLabelOpt = _this$options9.selectLabel,
|
|
@@ -51740,14 +52114,14 @@ var plugins_interaction_modules = {
|
|
|
51740
52114
|
{
|
|
51741
52115
|
result.dataIndex.splice(selectLabelOpt.limit);
|
|
51742
52116
|
result.label = result.dataIndex.map(function (i) {
|
|
51743
|
-
return
|
|
52117
|
+
return _this5.data.labels[i];
|
|
51744
52118
|
});
|
|
51745
52119
|
var dataEntries = Object.entries(this.data.data);
|
|
51746
52120
|
result.data = result.dataIndex.map(function (labelIdx) {
|
|
51747
|
-
return Object.fromEntries(dataEntries.map(function (
|
|
51748
|
-
var
|
|
51749
|
-
sId =
|
|
51750
|
-
data =
|
|
52121
|
+
return Object.fromEntries(dataEntries.map(function (_ref10) {
|
|
52122
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
52123
|
+
sId = _ref11[0],
|
|
52124
|
+
data = _ref11[1];
|
|
51751
52125
|
|
|
51752
52126
|
return [sId, data[labelIdx]];
|
|
51753
52127
|
}));
|
|
@@ -51770,12 +52144,12 @@ var plugins_interaction_modules = {
|
|
|
51770
52144
|
}
|
|
51771
52145
|
|
|
51772
52146
|
result.label = result.dataIndex.map(function (i) {
|
|
51773
|
-
return
|
|
52147
|
+
return _this5.data.labels[targetAxisDirection][i];
|
|
51774
52148
|
});
|
|
51775
52149
|
var dataValues = Object.values(this.data.data)[0];
|
|
51776
|
-
result.data = dataValues.filter(function (
|
|
51777
|
-
var x =
|
|
51778
|
-
y =
|
|
52150
|
+
result.data = dataValues.filter(function (_ref12) {
|
|
52151
|
+
var x = _ref12.x,
|
|
52152
|
+
y = _ref12.y;
|
|
51779
52153
|
return result.label.includes(targetAxisDirection === 'y' ? y : x);
|
|
51780
52154
|
});
|
|
51781
52155
|
break;
|
|
@@ -51898,14 +52272,14 @@ var plugins_interaction_modules = {
|
|
|
51898
52272
|
* object.range: coordinate-based range in graph
|
|
51899
52273
|
* @returns {object}
|
|
51900
52274
|
*/
|
|
51901
|
-
getSelectionRange: function getSelectionRange(
|
|
52275
|
+
getSelectionRange: function getSelectionRange(_ref13) {
|
|
51902
52276
|
var _this$boxOverflow, _this$boxOverflow2, _this$boxOverflow3, _this$boxOverflow4;
|
|
51903
52277
|
|
|
51904
|
-
var xsp =
|
|
51905
|
-
ysp =
|
|
51906
|
-
width =
|
|
51907
|
-
height =
|
|
51908
|
-
range =
|
|
52278
|
+
var xsp = _ref13.xsp,
|
|
52279
|
+
ysp = _ref13.ysp,
|
|
52280
|
+
width = _ref13.width,
|
|
52281
|
+
height = _ref13.height,
|
|
52282
|
+
range = _ref13.range;
|
|
51909
52283
|
var dataRangeX = this.axesSteps.x.length ? this.axesSteps.x[0] : null;
|
|
51910
52284
|
var dataRangeY = this.axesSteps.y.length ? this.axesSteps.y[0] : null;
|
|
51911
52285
|
|
|
@@ -51962,11 +52336,11 @@ var plugins_interaction_modules = {
|
|
|
51962
52336
|
|
|
51963
52337
|
var sId = Object.keys(this.seriesList)[0];
|
|
51964
52338
|
|
|
51965
|
-
var
|
|
51966
|
-
xMin =
|
|
51967
|
-
xMax =
|
|
51968
|
-
yMin =
|
|
51969
|
-
yMax =
|
|
52339
|
+
var _ref14 = (_this$seriesList$sId$ = this.seriesList[sId].findSelectionRange(range)) !== null && _this$seriesList$sId$ !== void 0 ? _this$seriesList$sId$ : {},
|
|
52340
|
+
xMin = _ref14.xMin,
|
|
52341
|
+
xMax = _ref14.xMax,
|
|
52342
|
+
yMin = _ref14.yMin,
|
|
52343
|
+
yMax = _ref14.yMax;
|
|
51970
52344
|
|
|
51971
52345
|
return {
|
|
51972
52346
|
xMin: xMin !== null && xMin !== void 0 ? xMin : dataRangeX.graphMin,
|
|
@@ -52056,6 +52430,7 @@ var plugins_interaction_modules = {
|
|
|
52056
52430
|
|
|
52057
52431
|
|
|
52058
52432
|
|
|
52433
|
+
|
|
52059
52434
|
var LINE_SPACING = 8;
|
|
52060
52435
|
var VALUE_MARGIN = 50;
|
|
52061
52436
|
var SCROLL_WIDTH = 17;
|
|
@@ -52846,7 +53221,7 @@ var plugins_tooltip_modules = {
|
|
|
52846
53221
|
y1: this.chartRect.y1 + this.labelOffset.top,
|
|
52847
53222
|
y2: this.chartRect.y2 - this.labelOffset.bottom
|
|
52848
53223
|
};
|
|
52849
|
-
var mouseXIp =
|
|
53224
|
+
var mouseXIp = 5; // mouseInterpolation - increased for better edge detection
|
|
52850
53225
|
|
|
52851
53226
|
var mouseYIp = 10;
|
|
52852
53227
|
var options = this.options;
|
|
@@ -52942,7 +53317,8 @@ var plugins_tooltip_modules = {
|
|
|
52942
53317
|
|
|
52943
53318
|
var horizontal = _ref5.horizontal,
|
|
52944
53319
|
label = _ref5.label,
|
|
52945
|
-
mousePosition = _ref5.mousePosition
|
|
53320
|
+
mousePosition = _ref5.mousePosition,
|
|
53321
|
+
useAxisTrigger = _ref5.useAxisTrigger;
|
|
52946
53322
|
|
|
52947
53323
|
if (!mousePosition || !!horizontal !== !!this.options.horizontal) {
|
|
52948
53324
|
return;
|
|
@@ -52989,7 +53365,25 @@ var plugins_tooltip_modules = {
|
|
|
52989
53365
|
y2: this.chartRect.y2 - this.labelOffset.bottom
|
|
52990
53366
|
};
|
|
52991
53367
|
|
|
52992
|
-
if (
|
|
53368
|
+
if (useAxisTrigger && label) {
|
|
53369
|
+
var _this$data$labels5;
|
|
53370
|
+
|
|
53371
|
+
var matchIndex = (_this$data$labels5 = this.data.labels) === null || _this$data$labels5 === void 0 ? void 0 : _this$data$labels5.findIndex(function (l) {
|
|
53372
|
+
return (l === null || l === void 0 ? void 0 : l.valueOf()) === (label === null || label === void 0 ? void 0 : label.valueOf());
|
|
53373
|
+
});
|
|
53374
|
+
|
|
53375
|
+
if (matchIndex >= 0) {
|
|
53376
|
+
var _Object$keys, _this$seriesList, _this$seriesList$seri, _this$seriesList$seri2;
|
|
53377
|
+
|
|
53378
|
+
var seriesId = (_Object$keys = Object.keys(this.seriesList)) === null || _Object$keys === void 0 ? void 0 : _Object$keys[0];
|
|
53379
|
+
var dataPoint = (_this$seriesList = this.seriesList) === null || _this$seriesList === void 0 ? void 0 : (_this$seriesList$seri = _this$seriesList[seriesId]) === null || _this$seriesList$seri === void 0 ? void 0 : (_this$seriesList$seri2 = _this$seriesList$seri.data) === null || _this$seriesList$seri2 === void 0 ? void 0 : _this$seriesList$seri2[matchIndex];
|
|
53380
|
+
|
|
53381
|
+
if ((dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.xp) !== undefined && (dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.xp) !== null) {
|
|
53382
|
+
var yPosition = !lodash_es_isNil(dataPoint.yp) ? dataPoint.yp : (graphPos.y1 + graphPos.y2) / 2;
|
|
53383
|
+
this.drawIndicator([dataPoint.xp, yPosition], this.options.indicator.color);
|
|
53384
|
+
}
|
|
53385
|
+
}
|
|
53386
|
+
} else if (horizontal) {
|
|
52993
53387
|
var chartHeight = graphPos.y2 - graphPos.y1;
|
|
52994
53388
|
var offsetY = chartHeight * (label - fromTime) / (toTime - fromTime) + graphPos.y1;
|
|
52995
53389
|
this.drawIndicator([graphPos.x2, offsetY], this.options.indicator.color);
|
|
@@ -53340,7 +53734,6 @@ var plugins_pie_modules = {
|
|
|
53340
53734
|
|
|
53341
53735
|
|
|
53342
53736
|
|
|
53343
|
-
|
|
53344
53737
|
var element_tip_modules = {
|
|
53345
53738
|
/**
|
|
53346
53739
|
* Draw TextTip with tip's locationInfo
|
|
@@ -53374,8 +53767,7 @@ var element_tip_modules = {
|
|
|
53374
53767
|
}
|
|
53375
53768
|
|
|
53376
53769
|
if (labelTipOpt.use && labelTipOpt.showTip) {
|
|
53377
|
-
|
|
53378
|
-
isExistSelectedLabel = isHeatMap ? this.drawLabelTipForHeatMap() : this.drawLabelTip();
|
|
53770
|
+
isExistSelectedLabel = opt.type === 'heatMap' ? this.drawLabelTipForHeatMap() : this.drawTipForSelectedLabel();
|
|
53379
53771
|
}
|
|
53380
53772
|
|
|
53381
53773
|
var executeDrawIndicator = function executeDrawIndicator(tipOpt) {
|
|
@@ -53661,9 +54053,10 @@ var element_tip_modules = {
|
|
|
53661
54053
|
|
|
53662
54054
|
/**
|
|
53663
54055
|
* Draw Selected Label Tip
|
|
54056
|
+
* none Text
|
|
53664
54057
|
* @returns {boolean} Whether drew at least one tip
|
|
53665
54058
|
*/
|
|
53666
|
-
|
|
54059
|
+
drawTipForSelectedLabel: function drawTipForSelectedLabel() {
|
|
53667
54060
|
var _this2 = this;
|
|
53668
54061
|
|
|
53669
54062
|
var opt = this.options;
|
|
@@ -53689,7 +54082,7 @@ var element_tip_modules = {
|
|
|
53689
54082
|
};
|
|
53690
54083
|
var labelAxes = isHorizontal ? this.axesY[0] : this.axesX[0];
|
|
53691
54084
|
var valueAxes = isHorizontal ? this.axesX[0] : this.axesY[0];
|
|
53692
|
-
var
|
|
54085
|
+
var valueAxesSteps = isHorizontal ? this.axesSteps.x[0] : this.axesSteps.y[0];
|
|
53693
54086
|
var valuePositionCalcFunction = isHorizontal ? helpers_canvas.calculateX : helpers_canvas.calculateY;
|
|
53694
54087
|
var labelPositionCalcFunction = isHorizontal ? helpers_canvas.calculateY : helpers_canvas.calculateX;
|
|
53695
54088
|
var scrollbarOpt = isHorizontal ? this.scrollbar.y : this.scrollbar.x;
|
|
@@ -53707,8 +54100,8 @@ var element_tip_modules = {
|
|
|
53707
54100
|
return _this2.seriesList[sId].isExistGrp && !_this2.seriesList[sId].isOverlapping;
|
|
53708
54101
|
});
|
|
53709
54102
|
var groups = (_this$data$groups$ = (_this$data$groups = this.data.groups) === null || _this$data$groups === void 0 ? void 0 : _this$data$groups[0]) !== null && _this$data$groups$ !== void 0 ? _this$data$groups$ : [];
|
|
53710
|
-
var
|
|
53711
|
-
var
|
|
54103
|
+
var labelPos;
|
|
54104
|
+
var dataPos;
|
|
53712
54105
|
var value;
|
|
53713
54106
|
var labelStartPoint;
|
|
53714
54107
|
var labelEndPoint;
|
|
@@ -53756,31 +54149,39 @@ var element_tip_modules = {
|
|
|
53756
54149
|
}
|
|
53757
54150
|
|
|
53758
54151
|
data.forEach(function (selectedData, i) {
|
|
53759
|
-
|
|
53760
|
-
|
|
53761
|
-
|
|
53762
|
-
|
|
53763
|
-
var
|
|
53764
|
-
|
|
53765
|
-
|
|
53766
|
-
|
|
53767
|
-
|
|
53768
|
-
|
|
53769
|
-
|
|
53770
|
-
var
|
|
53771
|
-
|
|
53772
|
-
|
|
53773
|
-
|
|
53774
|
-
|
|
53775
|
-
|
|
53776
|
-
|
|
53777
|
-
var
|
|
53778
|
-
|
|
53779
|
-
|
|
53780
|
-
|
|
53781
|
-
|
|
53782
|
-
|
|
53783
|
-
|
|
54152
|
+
value = valueAxesSteps.graphMax;
|
|
54153
|
+
|
|
54154
|
+
if (!labelTipOpt.fixedPosTop) {
|
|
54155
|
+
if (isExistGrp) {
|
|
54156
|
+
var _visibleSeries$filter, _visibleSeries$filter2;
|
|
54157
|
+
|
|
54158
|
+
var positiveSum = visibleSeries === null || visibleSeries === void 0 ? void 0 : visibleSeries.reduce(function (ac, sId) {
|
|
54159
|
+
var _selectedData$sId$val, _selectedData$sId, _selectedData$sId$val2, _selectedData$sId2;
|
|
54160
|
+
|
|
54161
|
+
return groups.includes(sId) && ((_selectedData$sId$val = (_selectedData$sId = selectedData[sId]) === null || _selectedData$sId === void 0 ? void 0 : _selectedData$sId.value) !== null && _selectedData$sId$val !== void 0 ? _selectedData$sId$val : selectedData[sId]) > 0 ? ac + ((_selectedData$sId$val2 = (_selectedData$sId2 = selectedData[sId]) === null || _selectedData$sId2 === void 0 ? void 0 : _selectedData$sId2.value) !== null && _selectedData$sId$val2 !== void 0 ? _selectedData$sId$val2 : selectedData[sId]) : ac;
|
|
54162
|
+
}, 0);
|
|
54163
|
+
var nonGroupValues = (_visibleSeries$filter = visibleSeries === null || visibleSeries === void 0 ? void 0 : (_visibleSeries$filter2 = visibleSeries.filter(function (sId) {
|
|
54164
|
+
return !groups.includes(sId);
|
|
54165
|
+
})) === null || _visibleSeries$filter2 === void 0 ? void 0 : _visibleSeries$filter2.map(function (sId) {
|
|
54166
|
+
var _selectedData$sId$val3, _selectedData$sId3;
|
|
54167
|
+
|
|
54168
|
+
return (_selectedData$sId$val3 = (_selectedData$sId3 = selectedData[sId]) === null || _selectedData$sId3 === void 0 ? void 0 : _selectedData$sId3.value) !== null && _selectedData$sId$val3 !== void 0 ? _selectedData$sId$val3 : selectedData[sId];
|
|
54169
|
+
})) !== null && _visibleSeries$filter !== void 0 ? _visibleSeries$filter : [];
|
|
54170
|
+
var maxNonGroupValue = (nonGroupValues === null || nonGroupValues === void 0 ? void 0 : nonGroupValues.length) > 0 ? nonGroupValues.reduce(function (max, val) {
|
|
54171
|
+
return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
|
|
54172
|
+
}, -Infinity) : -Infinity;
|
|
54173
|
+
value = positiveSum > 0 ? Math.max(maxNonGroupValue, positiveSum) : Math.max(maxNonGroupValue, 0);
|
|
54174
|
+
} else if (visibleSeries.length) {
|
|
54175
|
+
var visibleValue = visibleSeries.map(function (sId) {
|
|
54176
|
+
var _selectedData$sId$val4, _selectedData$sId4;
|
|
54177
|
+
|
|
54178
|
+
return (_selectedData$sId$val4 = (_selectedData$sId4 = selectedData[sId]) === null || _selectedData$sId4 === void 0 ? void 0 : _selectedData$sId4.value) !== null && _selectedData$sId$val4 !== void 0 ? _selectedData$sId$val4 : selectedData[sId];
|
|
54179
|
+
});
|
|
54180
|
+
var maxValue = visibleValue.length > 0 ? visibleValue.reduce(function (max, val) {
|
|
54181
|
+
return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
|
|
54182
|
+
}, -Infinity) : -Infinity;
|
|
54183
|
+
value = maxValue > 0 || _this2.options.type !== 'bar' ? maxValue : 0;
|
|
54184
|
+
}
|
|
53784
54185
|
}
|
|
53785
54186
|
|
|
53786
54187
|
if (labelAxes.labels) {
|
|
@@ -53790,18 +54191,17 @@ var element_tip_modules = {
|
|
|
53790
54191
|
|
|
53791
54192
|
var labelIndex = dataIndex[i] - startIndex;
|
|
53792
54193
|
var labelCenter = Math.round(labelStartPoint + labelGap * labelIndex);
|
|
53793
|
-
|
|
54194
|
+
labelPos = labelCenter + labelGap / 2;
|
|
53794
54195
|
} else {
|
|
53795
|
-
|
|
54196
|
+
labelPos = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
|
|
53796
54197
|
}
|
|
53797
54198
|
|
|
53798
|
-
|
|
53799
|
-
gp += offset;
|
|
54199
|
+
dataPos = valuePositionCalcFunction(value, valueAxesSteps.graphMin, valueAxesSteps.graphMax, valueSpace, valueStartPoint) + offset;
|
|
53800
54200
|
|
|
53801
54201
|
_this2.showTip({
|
|
53802
54202
|
context: _this2.bufferCtx,
|
|
53803
|
-
x: isHorizontal ?
|
|
53804
|
-
y: isHorizontal ?
|
|
54203
|
+
x: isHorizontal ? dataPos : labelPos,
|
|
54204
|
+
y: isHorizontal ? labelPos : dataPos,
|
|
53805
54205
|
opt: labelTipOpt,
|
|
53806
54206
|
isSamePos: false
|
|
53807
54207
|
});
|
|
@@ -53913,10 +54313,11 @@ var element_tip_modules = {
|
|
|
53913
54313
|
}
|
|
53914
54314
|
} else if (isHorizontal) {
|
|
53915
54315
|
gp = helpers_canvas.calculateX(value, graphX.graphMin, graphX.graphMax, xArea, xsp);
|
|
53916
|
-
gp
|
|
54316
|
+
gp = value < 0 ? gp - offset : gp + offset;
|
|
53917
54317
|
} else {
|
|
53918
|
-
|
|
53919
|
-
gp
|
|
54318
|
+
var adjustedValue = type === 'bar' && value < 0 ? 0 : value;
|
|
54319
|
+
gp = helpers_canvas.calculateY(adjustedValue, graphY.graphMin, graphY.graphMax, yArea, ysp);
|
|
54320
|
+
gp = adjustedValue < 0 ? gp + offset : gp - offset;
|
|
53920
54321
|
}
|
|
53921
54322
|
|
|
53922
54323
|
var maxTipType = 'center';
|
|
@@ -53948,7 +54349,8 @@ var element_tip_modules = {
|
|
|
53948
54349
|
arrowSize: arrowSize,
|
|
53949
54350
|
borderRadius: borderRadius,
|
|
53950
54351
|
text: text,
|
|
53951
|
-
textStyle: textStyle
|
|
54352
|
+
textStyle: textStyle,
|
|
54353
|
+
isNegative: value < 0
|
|
53952
54354
|
});
|
|
53953
54355
|
}
|
|
53954
54356
|
|
|
@@ -53982,12 +54384,21 @@ var element_tip_modules = {
|
|
|
53982
54384
|
borderRadius = param.borderRadius,
|
|
53983
54385
|
text = param.text,
|
|
53984
54386
|
opt = param.opt,
|
|
53985
|
-
textStyle = param.textStyle
|
|
54387
|
+
textStyle = param.textStyle,
|
|
54388
|
+
isNegative = param.isNegative;
|
|
53986
54389
|
var ctx = param.context;
|
|
53987
54390
|
var sx = x - width / 2;
|
|
53988
54391
|
var ex = x + width / 2;
|
|
53989
54392
|
var sy = y - height;
|
|
53990
54393
|
var ey = y;
|
|
54394
|
+
|
|
54395
|
+
if (isNegative) {
|
|
54396
|
+
if (isHorizontal) {
|
|
54397
|
+
sx = x - width / 2 - width;
|
|
54398
|
+
ex = x - width / 2;
|
|
54399
|
+
}
|
|
54400
|
+
}
|
|
54401
|
+
|
|
53991
54402
|
ctx.save();
|
|
53992
54403
|
ctx.font = textStyle;
|
|
53993
54404
|
ctx.fillStyle = (_opt$tipBackground = opt.tipBackground) !== null && _opt$tipBackground !== void 0 ? _opt$tipBackground : opt.tipStyle.background;
|
|
@@ -53995,44 +54406,73 @@ var element_tip_modules = {
|
|
|
53995
54406
|
ctx.beginPath();
|
|
53996
54407
|
ctx.moveTo(sx + borderRadius, sy);
|
|
53997
54408
|
ctx.quadraticCurveTo(sx, sy, sx, sy + borderRadius);
|
|
53998
|
-
|
|
53999
|
-
if (isHorizontal) {
|
|
54000
|
-
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
54001
|
-
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
54002
|
-
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
54003
|
-
}
|
|
54004
|
-
|
|
54005
54409
|
ctx.lineTo(sx, ey - borderRadius);
|
|
54006
54410
|
ctx.quadraticCurveTo(sx, ey, sx + borderRadius, ey);
|
|
54007
|
-
|
|
54008
|
-
if (!isHorizontal) {
|
|
54009
|
-
if (type === 'left') {
|
|
54010
|
-
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54011
|
-
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54012
|
-
} else if (type === 'right') {
|
|
54013
|
-
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54014
|
-
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54015
|
-
} else {
|
|
54016
|
-
ctx.lineTo(x - arrowSize, ey);
|
|
54017
|
-
ctx.lineTo(x, ey + arrowSize);
|
|
54018
|
-
ctx.lineTo(x + arrowSize, ey);
|
|
54019
|
-
}
|
|
54020
|
-
}
|
|
54021
|
-
|
|
54022
54411
|
ctx.lineTo(ex - borderRadius, ey);
|
|
54023
54412
|
ctx.quadraticCurveTo(ex, ey, ex, ey - borderRadius);
|
|
54024
54413
|
ctx.lineTo(ex, sy + borderRadius);
|
|
54025
54414
|
ctx.quadraticCurveTo(ex, sy, ex - borderRadius, sy);
|
|
54026
54415
|
ctx.lineTo(sx + borderRadius, sy);
|
|
54027
54416
|
ctx.closePath();
|
|
54028
|
-
ctx.fill();
|
|
54417
|
+
ctx.fill(); // draw arrow
|
|
54418
|
+
|
|
54419
|
+
ctx.beginPath();
|
|
54420
|
+
|
|
54421
|
+
if (isHorizontal) {
|
|
54422
|
+
if (isNegative) {
|
|
54423
|
+
ctx.moveTo(ex, ey);
|
|
54424
|
+
ctx.lineTo(ex, sy + borderRadius + arrowSize / 2);
|
|
54425
|
+
ctx.lineTo(ex + arrowSize, ey - height / 2);
|
|
54426
|
+
ctx.lineTo(ex, ey - borderRadius - arrowSize / 2);
|
|
54427
|
+
} else {
|
|
54428
|
+
ctx.moveTo(sx, sy);
|
|
54429
|
+
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
54430
|
+
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
54431
|
+
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
54432
|
+
}
|
|
54433
|
+
|
|
54434
|
+
ctx.closePath();
|
|
54435
|
+
ctx.fill();
|
|
54436
|
+
} else {
|
|
54437
|
+
if (isNegative) {
|
|
54438
|
+
if (type === 'left') {
|
|
54439
|
+
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54440
|
+
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54441
|
+
} else if (type === 'right') {
|
|
54442
|
+
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54443
|
+
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54444
|
+
} else {
|
|
54445
|
+
ctx.lineTo(x - arrowSize, ey);
|
|
54446
|
+
ctx.lineTo(x, ey + arrowSize);
|
|
54447
|
+
ctx.lineTo(x + arrowSize, ey);
|
|
54448
|
+
}
|
|
54449
|
+
} else if (!isNegative) {
|
|
54450
|
+
if (type === 'left') {
|
|
54451
|
+
ctx.moveTo(sx, sy);
|
|
54452
|
+
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54453
|
+
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54454
|
+
} else if (type === 'right') {
|
|
54455
|
+
ctx.moveTo(ex, sy);
|
|
54456
|
+
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54457
|
+
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54458
|
+
} else {
|
|
54459
|
+
ctx.lineTo(x - arrowSize, ey);
|
|
54460
|
+
ctx.lineTo(x, ey + arrowSize);
|
|
54461
|
+
ctx.lineTo(x + arrowSize, ey);
|
|
54462
|
+
}
|
|
54463
|
+
}
|
|
54464
|
+
|
|
54465
|
+
ctx.closePath();
|
|
54466
|
+
ctx.fill();
|
|
54467
|
+
}
|
|
54468
|
+
|
|
54029
54469
|
ctx.restore();
|
|
54030
54470
|
ctx.save();
|
|
54031
54471
|
ctx.font = textStyle;
|
|
54032
54472
|
ctx.fillStyle = (_opt$tipTextColor = opt.tipTextColor) !== null && _opt$tipTextColor !== void 0 ? _opt$tipTextColor : opt.tipStyle.textColor;
|
|
54033
54473
|
ctx.textBaseline = 'middle';
|
|
54034
54474
|
ctx.textAlign = 'center';
|
|
54035
|
-
ctx.fillText("".concat(text),
|
|
54475
|
+
ctx.fillText("".concat(text), sx + width / 2, sy + height / 2);
|
|
54036
54476
|
ctx.restore();
|
|
54037
54477
|
},
|
|
54038
54478
|
|
|
@@ -54284,11 +54724,13 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
54284
54724
|
value: function drawSyncedIndicator(_ref) {
|
|
54285
54725
|
var horizontal = _ref.horizontal,
|
|
54286
54726
|
label = _ref.label,
|
|
54287
|
-
mousePosition = _ref.mousePosition
|
|
54727
|
+
mousePosition = _ref.mousePosition,
|
|
54728
|
+
useAxisTrigger = _ref.useAxisTrigger;
|
|
54288
54729
|
this.drawSyncedIndicator({
|
|
54289
54730
|
horizontal: horizontal,
|
|
54290
54731
|
label: label,
|
|
54291
|
-
mousePosition: mousePosition
|
|
54732
|
+
mousePosition: mousePosition,
|
|
54733
|
+
useAxisTrigger: useAxisTrigger
|
|
54292
54734
|
});
|
|
54293
54735
|
}
|
|
54294
54736
|
}, {
|
|
@@ -54516,7 +54958,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
54516
54958
|
var chartType = chartKeys[ix];
|
|
54517
54959
|
var chartTypeSet = this.seriesInfo.charts[chartType];
|
|
54518
54960
|
|
|
54519
|
-
if (chartType === 'scatter') {
|
|
54961
|
+
if (chartType === 'scatter' && this.options.coordinateDedupe) {
|
|
54520
54962
|
this.collectDuplicatePoints(duple, chartTypeSet);
|
|
54521
54963
|
}
|
|
54522
54964
|
|
|
@@ -54625,7 +55067,8 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
54625
55067
|
series.draw(_objectSpread2({
|
|
54626
55068
|
legendHitInfo: _legendHitInfo4,
|
|
54627
55069
|
selectInfo: _selectInfo,
|
|
54628
|
-
duple: duple
|
|
55070
|
+
duple: duple,
|
|
55071
|
+
coordinateDedupe: this.options.coordinateDedupe
|
|
54629
55072
|
}, opt));
|
|
54630
55073
|
break;
|
|
54631
55074
|
}
|
|
@@ -56115,6 +56558,7 @@ var DEFAULT_OPTIONS = {
|
|
|
56115
56558
|
combo: false,
|
|
56116
56559
|
tooltip: {
|
|
56117
56560
|
use: true,
|
|
56561
|
+
trigger: 'axis',
|
|
56118
56562
|
sortByValue: true,
|
|
56119
56563
|
backgroundColor: '#4C4C4C',
|
|
56120
56564
|
fontColor: '#FFFFFF',
|
|
@@ -56270,7 +56714,8 @@ var DEFAULT_OPTIONS = {
|
|
|
56270
56714
|
error: '#FF0000',
|
|
56271
56715
|
decimalPoint: 0
|
|
56272
56716
|
},
|
|
56273
|
-
seriesReverse: false
|
|
56717
|
+
seriesReverse: false,
|
|
56718
|
+
coordinateDedupe: true
|
|
56274
56719
|
};
|
|
56275
56720
|
var DEFAULT_DATA = {
|
|
56276
56721
|
series: {},
|