evui 3.4.128 → 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.umd.js CHANGED
@@ -11183,7 +11183,7 @@ module.exports = exports;
11183
11183
  /***/ "9224":
11184
11184
  /***/ (function(module) {
11185
11185
 
11186
- module.exports = JSON.parse("{\"a\":\"3.4.128\"}");
11186
+ module.exports = JSON.parse("{\"a\":\"3.4.129\"}");
11187
11187
 
11188
11188
  /***/ }),
11189
11189
 
@@ -38512,26 +38512,26 @@ var es_string_match = __webpack_require__("466d");
38512
38512
  return value;
38513
38513
  }
38514
38514
 
38515
- var assignLabelWith = function assignLabelWith(v, target, lb) {
38516
- if (v % target === 0) {
38517
- return "".concat((v / target).toFixed(decimalPoint)).concat(lb);
38518
- }
38515
+ var isNegative = value < 0;
38516
+ var absValue = Math.abs(value);
38519
38517
 
38520
- return "".concat((v / target).toFixed(1)).concat(lb);
38521
- };
38522
-
38523
- if (value >= quad) {
38524
- label = assignLabelWith(value, quad, 'P');
38525
- } else if (value >= trill) {
38526
- label = assignLabelWith(value, trill, 'T');
38527
- } else if (value >= billi) {
38528
- label = assignLabelWith(value, billi, 'G');
38529
- } else if (value >= milli) {
38530
- label = assignLabelWith(value, milli, 'M');
38531
- } else if (value >= killo) {
38532
- label = assignLabelWith(value, 1000, 'K');
38518
+ var assignLabelWith = function assignLabelWith(v, target, lb) {
38519
+ var result = v % target === 0 ? "".concat((v / target).toFixed(decimalPoint)).concat(lb) : "".concat((v / target).toFixed(1)).concat(lb);
38520
+ return isNegative ? "-".concat(result) : result;
38521
+ };
38522
+
38523
+ if (absValue >= quad) {
38524
+ label = assignLabelWith(absValue, quad, 'P');
38525
+ } else if (absValue >= trill) {
38526
+ label = assignLabelWith(absValue, trill, 'T');
38527
+ } else if (absValue >= billi) {
38528
+ label = assignLabelWith(absValue, billi, 'G');
38529
+ } else if (absValue >= milli) {
38530
+ label = assignLabelWith(absValue, milli, 'M');
38531
+ } else if (absValue >= killo) {
38532
+ label = assignLabelWith(absValue, 1000, 'K');
38533
38533
  } else {
38534
- label = value.toFixed(decimalPoint);
38534
+ label = isNegative ? "-".concat(absValue.toFixed(decimalPoint)) : value.toFixed(decimalPoint);
38535
38535
  }
38536
38536
 
38537
38537
  return label;
@@ -38805,21 +38805,23 @@ var modules = {
38805
38805
  seriesIDs.forEach(function (seriesID) {
38806
38806
  var series = _this.seriesList[seriesID];
38807
38807
  var sData = data[seriesID];
38808
+ var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
38808
38809
 
38809
38810
  if (series && sData) {
38810
38811
  series.data = _this.addSeriesDSforScatter(sData);
38811
- series.minMax = _this.getSeriesMinMax(series.data);
38812
+ series.minMax = _this.getSeriesMinMax(series.data, passingValue);
38812
38813
  }
38813
38814
  });
38814
38815
  } else if (typeKey === 'heatMap') {
38815
38816
  seriesIDs.forEach(function (seriesID) {
38816
38817
  var series = _this.seriesList[seriesID];
38818
+ var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
38817
38819
  var sData = data[seriesID];
38818
38820
 
38819
38821
  if (series && sData) {
38820
38822
  series.labels = label;
38821
38823
  series.data = _this.addSeriesDSForHeatMap(sData);
38822
- series.minMax = _this.getSeriesMinMax(series.data);
38824
+ series.minMax = _this.getSeriesMinMax(series.data, passingValue);
38823
38825
  series.valueOpt = _this.getSeriesValueOptForHeatMap(series);
38824
38826
  }
38825
38827
  });
@@ -38851,7 +38853,7 @@ var modules = {
38851
38853
  series.data = _this.addSeriesDS(sData, label, series.isExistGrp);
38852
38854
  }
38853
38855
 
38854
- series.minMax = _this.getSeriesMinMax(series.data);
38856
+ series.minMax = _this.getSeriesMinMax(series.data, series.passingValue);
38855
38857
  }
38856
38858
  });
38857
38859
  }
@@ -39247,17 +39249,19 @@ var modules = {
39247
39249
  var isHorizontal = this.options.horizontal;
39248
39250
  var sdata = [];
39249
39251
 
39250
- var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex) {
39252
+ var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex, curr) {
39251
39253
  var nextBaseSeriesIndex = baseIndex - 1;
39252
39254
  var baseSeries = _this4.seriesList[bsIds[baseIndex]];
39253
39255
  var baseDataList = baseSeries.data;
39254
39256
  var baseData = baseDataList[dataIndex];
39255
39257
  var position = isHorizontal ? baseData === null || baseData === void 0 ? void 0 : baseData.x : baseData === null || baseData === void 0 ? void 0 : baseData.y;
39256
- var isPassingValue = baseSeries.passingValue === (baseData === null || baseData === void 0 ? void 0 : baseData.o);
39258
+ var baseValue = baseData === null || baseData === void 0 ? void 0 : baseData.o;
39259
+ var isPassingValue = !helpers_util.isNullOrUndefined(baseSeries === null || baseSeries === void 0 ? void 0 : baseSeries.passingValue) && (baseSeries === null || baseSeries === void 0 ? void 0 : baseSeries.passingValue) === baseValue;
39260
+ var isSameSign = curr >= 0 && baseValue >= 0 || curr < 0 && baseValue < 0;
39257
39261
 
39258
- if (isPassingValue || position == null || !baseSeries.show) {
39262
+ if (isPassingValue || position == null || !isSameSign || !baseSeries.show) {
39259
39263
  if (nextBaseSeriesIndex > -1) {
39260
- return getBaseDataPosition(nextBaseSeriesIndex, dataIndex);
39264
+ return getBaseDataPosition(nextBaseSeriesIndex, dataIndex, curr);
39261
39265
  }
39262
39266
 
39263
39267
  return 0;
@@ -39268,7 +39272,7 @@ var modules = {
39268
39272
 
39269
39273
  data.forEach(function (curr, index) {
39270
39274
  var baseIndex = bsIds.length - 1 < 0 ? 0 : bsIds.length - 1;
39271
- var bdata = getBaseDataPosition(baseIndex, index); // base(previous) series data
39275
+ var bdata = getBaseDataPosition(baseIndex, index, curr); // base(previous) series data
39272
39276
 
39273
39277
  var odata = curr; // current series original data
39274
39278
 
@@ -39451,7 +39455,7 @@ var modules = {
39451
39455
  *
39452
39456
  * @returns {object} min/max info for series
39453
39457
  */
39454
- getSeriesMinMax: function getSeriesMinMax(data) {
39458
+ getSeriesMinMax: function getSeriesMinMax(data, passingValue) {
39455
39459
  var def = {
39456
39460
  minX: null,
39457
39461
  minY: null,
@@ -39462,22 +39466,24 @@ var modules = {
39462
39466
  var isHorizontal = this.options.horizontal;
39463
39467
 
39464
39468
  if (data.length) {
39469
+ var usePassingValue = !helpers_util.isNullOrUndefined(passingValue);
39465
39470
  return data.reduce(function (acc, p, index) {
39466
- var _p$x, _p$y;
39471
+ var _p$x, _p$y, _p$o;
39467
39472
 
39468
39473
  var minmax = acc;
39469
39474
  var px = ((_p$x = p.x) === null || _p$x === void 0 ? void 0 : _p$x.value) || p.x;
39470
39475
  var py = ((_p$y = p.y) === null || _p$y === void 0 ? void 0 : _p$y.value) || p.y;
39476
+ var po = ((_p$o = p.o) === null || _p$o === void 0 ? void 0 : _p$o.value) || p.o;
39471
39477
 
39472
- if (px <= minmax.minX) {
39478
+ if (usePassingValue ? po !== passingValue && px <= minmax.minX : px <= minmax.minX) {
39473
39479
  minmax.minX = px === null ? 0 : px;
39474
39480
  }
39475
39481
 
39476
- if (py <= minmax.minY) {
39482
+ if (usePassingValue ? po !== passingValue && py <= minmax.minY : py <= minmax.minY) {
39477
39483
  minmax.minY = py === null ? 0 : py;
39478
39484
  }
39479
39485
 
39480
- if (px >= minmax.maxX) {
39486
+ if (usePassingValue ? po !== passingValue && px >= minmax.maxX : px >= minmax.maxX) {
39481
39487
  minmax.maxX = px === null ? 0 : px;
39482
39488
 
39483
39489
  if (isHorizontal && px !== null) {
@@ -39486,7 +39492,7 @@ var modules = {
39486
39492
  }
39487
39493
  }
39488
39494
 
39489
- if (py >= minmax.maxY) {
39495
+ if (usePassingValue ? po !== passingValue && py >= minmax.maxY : py >= minmax.maxY) {
39490
39496
  minmax.maxY = py === null ? 0 : py;
39491
39497
 
39492
39498
  if (!isHorizontal && py !== null) {
@@ -40240,14 +40246,25 @@ var modules = {
40240
40246
  }
40241
40247
  }
40242
40248
 
40243
- if (smm.maxX >= minmax.x[axisX].max) {
40249
+ var isExistGrp = _this10.seriesList[key].isExistGrp;
40250
+ var maxXisNegative = minmax.x[axisX].max < 0;
40251
+
40252
+ if (isExistGrp && maxXisNegative) {
40253
+ minmax.x[axisX].max = smm.maxX;
40254
+ minmax.x[axisX].maxSID = key;
40255
+ } else if (!minmax.x[axisX].max || smm.maxX >= minmax.x[axisX].max) {
40244
40256
  minmax.x[axisX].max = smm.maxX;
40245
40257
  minmax.x[axisX].maxSID = key;
40246
40258
  }
40247
40259
 
40248
- if (smm.maxY >= minmax.y[axisY].max) {
40260
+ var maxYisNegative = minmax.y[axisY].max < 0;
40261
+
40262
+ if (isExistGrp && maxYisNegative) {
40263
+ minmax.y[axisY].max = smm.maxY;
40264
+ minmax.y[axisY].maxSID = key;
40265
+ } else if (!minmax.y[axisY].max || smm.maxY >= minmax.y[axisY].max) {
40249
40266
  minmax.y[axisY].max = smm.maxY;
40250
- minmax.y[axisX].maxSID = key;
40267
+ minmax.y[axisY].maxSID = key;
40251
40268
  }
40252
40269
  }
40253
40270
 
@@ -41708,6 +41725,7 @@ var TIME_INTERVALS = {
41708
41725
 
41709
41726
 
41710
41727
 
41728
+
41711
41729
  var element_line_Line = /*#__PURE__*/function () {
41712
41730
  function Line(sId, opt, sIdx) {
41713
41731
  var _this = this;
@@ -41841,7 +41859,6 @@ var element_line_Line = /*#__PURE__*/function () {
41841
41859
  ctx.setLineDash(this.segments);
41842
41860
  }
41843
41861
 
41844
- var endPoint = chartRect.y2 - labelOffset.bottom;
41845
41862
  var isLinearInterpolation = this.useLinearInterpolation();
41846
41863
  var barAreaByCombo = 0;
41847
41864
  var minmaxX = axesSteps.x[this.xAxisIndex];
@@ -41864,8 +41881,12 @@ var element_line_Line = /*#__PURE__*/function () {
41864
41881
 
41865
41882
  var getYPos = function getYPos(val) {
41866
41883
  return helpers_canvas.calculateY(val, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
41867
- }; // draw line
41884
+ };
41868
41885
 
41886
+ var includeNegativeValue = this.data.some(function (data) {
41887
+ return data.o < 0;
41888
+ });
41889
+ var endPoint = includeNegativeValue ? getYPos(0) : chartRect.y2 - labelOffset.bottom; // draw line
41869
41890
 
41870
41891
  var prevValid;
41871
41892
  this.data.forEach(function (curr) {
@@ -41925,9 +41946,10 @@ var element_line_Line = /*#__PURE__*/function () {
41925
41946
  }
41926
41947
  });
41927
41948
  var gradient = ctx.createLinearGradient(0, chartRect.y2, 0, maxValueYPos);
41928
- gradient.addColorStop(0, fillColor);
41949
+ var mainGradientColor = extent.opacity < 1 ? fillColor : mainColor;
41950
+ gradient.addColorStop(0, includeNegativeValue ? mainGradientColor : fillColor);
41929
41951
  gradient.addColorStop(0.5, fillColor);
41930
- gradient.addColorStop(1, extent.opacity < 1 ? fillColor : mainColor);
41952
+ gradient.addColorStop(1, mainGradientColor);
41931
41953
  ctx.fillStyle = gradient;
41932
41954
  } else {
41933
41955
  ctx.fillStyle = fillColor;
@@ -41995,7 +42017,7 @@ var element_line_Line = /*#__PURE__*/function () {
41995
42017
 
41996
42018
  var nextData = _this2.data[jx];
41997
42019
  var xp = getXPos(nextData.x);
41998
- var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : endPoint;
42020
+ var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : getYPos(0);
41999
42021
  ctx.lineTo(xp, bp);
42000
42022
  }
42001
42023
 
@@ -42106,22 +42128,23 @@ var element_line_Line = /*#__PURE__*/function () {
42106
42128
 
42107
42129
  var s = 0;
42108
42130
  var e = gdata.length - 1;
42109
- var xpInterval = ((_gdata$ = gdata[1]) === null || _gdata$ === void 0 ? void 0 : _gdata$.xp) - gdata[0].xp < 6 ? 1.5 : 6;
42131
+ var gap = Math.ceil(Math.abs(((_gdata$ = gdata[1]) === null || _gdata$ === void 0 ? void 0 : _gdata$.xp) - gdata[0].xp) / 2) || 0;
42132
+ var xpInterval = Math.max(gap, 6);
42110
42133
 
42111
42134
  while (s <= e) {
42112
42135
  var m = Math.floor((s + e) / 2);
42113
42136
  var x = gdata[m].xp;
42114
42137
  var y = gdata[m].yp;
42115
42138
 
42116
- if (x - xpInterval < xp && xp < x + xpInterval) {
42139
+ if (x - xpInterval <= xp && xp <= x + xpInterval) {
42117
42140
  var _gdata$m, _gdata$xp, _gdata, _gdata2, _gdata3;
42118
42141
 
42119
42142
  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);
42120
42143
 
42121
42144
  if ((_gdata2 = gdata[m - 1]) !== null && _gdata2 !== void 0 && _gdata2.xp && (_gdata3 = gdata[m + 1]) !== null && _gdata3 !== void 0 && _gdata3.xp && curXpInterval > 0) {
42122
- var leftXp = xp - gdata[m - 1].xp;
42145
+ var leftXp = Math.abs(xp - gdata[m - 1].xp);
42123
42146
  var midXp = Math.abs(xp - gdata[m].xp);
42124
- var rightXp = gdata[m + 1].xp - xp;
42147
+ var rightXp = Math.abs(gdata[m + 1].xp - xp);
42125
42148
 
42126
42149
  if (Math.abs(this.beforeMouseXp - xp) >= curXpInterval - SPARE_XP && (this.beforeFindItemIndex === m || midXp === rightXp || midXp === leftXp)) {
42127
42150
  if (this.beforeMouseXp - xp > 0) {
@@ -42769,8 +42792,12 @@ var element_bar_Bar = /*#__PURE__*/function () {
42769
42792
 
42770
42793
  var xArea = chartRect.chartWidth - (labelOffset.left + labelOffset.right);
42771
42794
  var yArea = chartRect.chartHeight - (labelOffset.top + labelOffset.bottom);
42772
- var xsp = chartRect.x1 + labelOffset.left;
42773
- var ysp = chartRect.y2 - labelOffset.bottom;
42795
+ var xAxisPosition = chartRect.x1 + labelOffset.left;
42796
+ var yAxisPosition = chartRect.y2 - labelOffset.bottom;
42797
+ var xZeroPosition = helpers_canvas.calculateX(0, minmaxX.graphMin, minmaxX.graphMax, xArea);
42798
+ var yZeroPosition = helpers_canvas.calculateY(0, minmaxY.graphMin, minmaxY.graphMax, yArea);
42799
+ var xsp = isHorizontal ? xAxisPosition + xZeroPosition : xAxisPosition;
42800
+ var ysp = isHorizontal ? yAxisPosition : yAxisPosition + yZeroPosition;
42774
42801
  var dArea = isHorizontal ? yArea : xArea;
42775
42802
  var cArea = dArea / (totalCount || 1);
42776
42803
  var cPad;
@@ -42834,7 +42861,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
42834
42861
  categoryPoint = ysp - cArea * screenIndex - cPad;
42835
42862
  } else {
42836
42863
  categoryPoint = xsp + cArea * screenIndex + cPad;
42837
- }
42864
+ } // 기본 위치 설정
42865
+
42838
42866
 
42839
42867
  if (isHorizontal) {
42840
42868
  x = xsp;
@@ -42842,22 +42870,30 @@ var element_bar_Bar = /*#__PURE__*/function () {
42842
42870
  } else {
42843
42871
  x = Math.round(categoryPoint + (bArea * barSeriesX - (w + bPad)));
42844
42872
  y = ysp;
42845
- }
42873
+ } // 너비 / 높이 계산, 스택의 경우 위치 값 재계산
42874
+
42846
42875
 
42847
42876
  if (isHorizontal) {
42877
+ var barValue = item.b ? item.o : item.x;
42878
+ w = helpers_canvas.calculateX(barValue, minmaxX.graphMin, minmaxX.graphMax, xArea, -xZeroPosition);
42879
+
42848
42880
  if (item.b) {
42849
- w = helpers_canvas.calculateX(item.x - item.b, minmaxX.graphMin, minmaxX.graphMax, xArea);
42850
- x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp);
42851
- } else {
42852
- w = helpers_canvas.calculateX(item.x, minmaxX.graphMin, minmaxX.graphMax, xArea);
42881
+ x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp - xZeroPosition);
42853
42882
  }
42854
- } else if (item.b) {
42855
- // vertical stack bar chart
42856
- h = helpers_canvas.calculateY(item.y - item.b, minmaxY.graphMin, minmaxY.graphMax, yArea);
42857
- y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
42883
+
42884
+ var minimumBarWidth = barValue > 0 ? -1 : 1;
42885
+ w = barValue && Math.abs(w) === 0 ? minimumBarWidth : w;
42858
42886
  } else {
42859
- // vertical bar chart
42860
- h = helpers_canvas.calculateY(item.y, minmaxY.graphMin, minmaxY.graphMax, yArea);
42887
+ var _barValue = item.b ? item.o : item.y;
42888
+
42889
+ h = helpers_canvas.calculateY(_barValue, minmaxY.graphMin, minmaxY.graphMax, yArea, -yZeroPosition);
42890
+
42891
+ if (item.b) {
42892
+ y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp - yZeroPosition);
42893
+ }
42894
+
42895
+ var minimumBarHeight = _barValue > 0 ? -1 : 1;
42896
+ h = _barValue && Math.abs(h) === 0 ? minimumBarHeight : h;
42861
42897
  }
42862
42898
 
42863
42899
  var barColor = item.dataColor || this.color;
@@ -43146,10 +43182,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
43146
43182
  align = _this$showValue.align,
43147
43183
  formatter = _this$showValue.formatter,
43148
43184
  decimalPoint = _this$showValue.decimalPoint;
43149
- var x = positions.x,
43150
- y = positions.y,
43151
- w = positions.w,
43152
- h = positions.h;
43185
+ var barX = positions.x,
43186
+ barY = positions.y,
43187
+ barWidth = positions.w,
43188
+ barHeight = positions.h;
43153
43189
  var ctx = context;
43154
43190
  ctx.save();
43155
43191
  ctx.beginPath();
@@ -43184,25 +43220,27 @@ var element_bar_Bar = /*#__PURE__*/function () {
43184
43220
  formattedTxt = (_Util$labelSignFormat = helpers_util.labelSignFormat(value, decimalPoint)) !== null && _Util$labelSignFormat !== void 0 ? _Util$labelSignFormat : '';
43185
43221
  }
43186
43222
 
43223
+ var isNegativeValue = value < 0;
43187
43224
  var textWidth = Math.round(ctx.measureText(formattedTxt).width);
43188
- var textHeight = fontSize + 4;
43189
- var minXPos = x + 10;
43190
- var minYPos = y - 10;
43191
- var widthFreeSpaceToDraw = w - 10;
43192
- var heightFreeSpaceToDraw = Math.abs(h + 10);
43193
- var centerX = x + w / 2 <= minXPos ? minXPos : x + w / 2;
43194
- var centerY = y + h / 2 >= minYPos ? minYPos : y + h / 2;
43195
- var centerYHorizontal = isHighlight ? y + h / 2 : y - h / 2;
43225
+ var textHeight = fontSize; // fontSize와 textHeight는 같을 수 없지만, 정확히 구할 필요 없음
43226
+
43227
+ var GAP = 10;
43228
+ var minXPos = isNegativeValue ? barX - GAP : barX + GAP;
43229
+ var minYPos = isNegativeValue ? barY + GAP : barY - GAP;
43230
+ var centerXOnBar = barX + barWidth / 2;
43231
+ var centerYOnBar = isHighlight ? barY + barHeight / 2 : barY - barHeight / 2;
43232
+ var drawableBarWidth = Math.abs(barWidth) - GAP;
43233
+ var drawableBarHeight = Math.abs(barHeight) - GAP;
43196
43234
 
43197
43235
  switch (align) {
43198
43236
  case 'start':
43199
43237
  {
43200
- if (isHorizontal) {
43201
- if (textWidth < widthFreeSpaceToDraw) {
43202
- ctx.fillText(formattedTxt, minXPos, centerYHorizontal);
43203
- }
43204
- } else if (textHeight < heightFreeSpaceToDraw) {
43205
- ctx.fillText(formattedTxt, centerX, minYPos);
43238
+ if (isHorizontal && textWidth < drawableBarWidth) {
43239
+ var xPos = isNegativeValue ? minXPos - textWidth : minXPos;
43240
+ ctx.fillText(formattedTxt, xPos, centerYOnBar);
43241
+ } else if (!isHorizontal && textHeight < drawableBarHeight) {
43242
+ var yPos = isNegativeValue ? barY + GAP : barY - GAP;
43243
+ ctx.fillText(formattedTxt, centerXOnBar, yPos);
43206
43244
  }
43207
43245
 
43208
43246
  break;
@@ -43210,12 +43248,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
43210
43248
 
43211
43249
  case 'center':
43212
43250
  {
43213
- if (isHorizontal) {
43214
- if (textWidth < widthFreeSpaceToDraw) {
43215
- ctx.fillText(formattedTxt, centerX, centerYHorizontal);
43216
- }
43217
- } else if (textHeight < heightFreeSpaceToDraw) {
43218
- ctx.fillText(formattedTxt, centerX, centerY);
43251
+ if (isHorizontal && textWidth < drawableBarWidth) {
43252
+ ctx.fillText(formattedTxt, centerXOnBar, centerYOnBar);
43253
+ } else if (!isHorizontal && textHeight < drawableBarHeight) {
43254
+ ctx.fillText(formattedTxt, centerXOnBar, barY + barHeight / 2);
43219
43255
  }
43220
43256
 
43221
43257
  break;
@@ -43229,9 +43265,26 @@ var element_bar_Bar = /*#__PURE__*/function () {
43229
43265
  }
43230
43266
 
43231
43267
  if (isHorizontal) {
43232
- ctx.fillText(formattedTxt, minXPos + w, centerYHorizontal);
43268
+ var minXOnChart = this.chartRect.x1 + this.labelOffset.left;
43269
+ var maxXOnChart = this.chartRect.x2 - this.labelOffset.right;
43270
+
43271
+ if (isNegativeValue) {
43272
+ var _xPos = barX - GAP + barWidth - textWidth;
43273
+
43274
+ if (_xPos > minXOnChart) {
43275
+ ctx.fillText(formattedTxt, _xPos, centerYOnBar);
43276
+ }
43277
+ } else {
43278
+ var _xPos2 = barX + GAP + barWidth;
43279
+
43280
+ if (_xPos2 + textWidth < maxXOnChart) {
43281
+ ctx.fillText(formattedTxt, _xPos2, centerYOnBar);
43282
+ }
43283
+ }
43233
43284
  } else {
43234
- ctx.fillText(formattedTxt, centerX, y + h - textHeight / 2);
43285
+ var _yPos = isNegativeValue ? barY + barHeight + GAP : barY + barHeight - GAP;
43286
+
43287
+ ctx.fillText(formattedTxt, centerXOnBar, _yPos);
43235
43288
  }
43236
43289
 
43237
43290
  break;
@@ -43240,14 +43293,22 @@ var element_bar_Bar = /*#__PURE__*/function () {
43240
43293
  default:
43241
43294
  case 'end':
43242
43295
  {
43243
- if (isHorizontal) {
43244
- if (textWidth < widthFreeSpaceToDraw) {
43245
- var xPos = x + w - textWidth * 2;
43246
- ctx.fillText(formattedTxt, xPos <= minXPos ? minXPos : xPos, centerYHorizontal);
43296
+ if (isHorizontal && textWidth < drawableBarWidth) {
43297
+ var _xPos3 = isNegativeValue ? barX + barWidth + GAP : barX + barWidth - textWidth - GAP;
43298
+
43299
+ ctx.fillText(formattedTxt, _xPos3, centerYOnBar);
43300
+ } else if (!isHorizontal) {
43301
+ if (isNegativeValue) {
43302
+ var _yPos2 = barY + barHeight - GAP;
43303
+
43304
+ if (_yPos2 > minYPos) {
43305
+ ctx.fillText(formattedTxt, centerXOnBar, _yPos2);
43306
+ }
43307
+ } else if (textHeight < drawableBarHeight) {
43308
+ var _yPos3 = barY + barHeight + GAP;
43309
+
43310
+ ctx.fillText(formattedTxt, centerXOnBar, _yPos3);
43247
43311
  }
43248
- } else if (textHeight < heightFreeSpaceToDraw) {
43249
- var yPos = y + h + textHeight;
43250
- ctx.fillText(formattedTxt, centerX, yPos >= minYPos ? minYPos : yPos);
43251
43312
  }
43252
43313
 
43253
43314
  break;
@@ -43304,28 +43365,50 @@ var element_bar_Bar = /*#__PURE__*/function () {
43304
43365
  ctx.beginPath();
43305
43366
  ctx.moveTo(x, y);
43306
43367
 
43368
+ if (Math.abs(w) < r * 2) {
43369
+ r = Math.abs(w) / 2;
43370
+ }
43371
+
43372
+ if (Math.abs(h) < r * 2) {
43373
+ r = Math.abs(h) / 2;
43374
+ }
43375
+
43307
43376
  if (isHorizontal) {
43308
- if (h < r * 2) {
43309
- r = h / 2;
43377
+ var isNegativeValue = w < 0;
43378
+
43379
+ if (isNegativeValue) {
43380
+ w += r;
43381
+ ctx.lineTo(x + w, y);
43382
+ ctx.arcTo(x + w - r, y, x + w - r, y - r, r);
43383
+ ctx.arcTo(x + w - r, y - h, x + w, y - h, r);
43384
+ ctx.lineTo(x, y - h);
43385
+ ctx.lineTo(x, y);
43386
+ } else {
43387
+ w -= r;
43388
+ ctx.lineTo(x + w, y);
43389
+ ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
43390
+ ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
43391
+ ctx.lineTo(x, y - h);
43392
+ ctx.lineTo(x, y);
43310
43393
  }
43311
-
43312
- w -= r;
43313
- ctx.lineTo(x + w, y);
43314
- ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
43315
- ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
43316
- ctx.lineTo(x, y - h);
43317
- ctx.lineTo(x, y);
43318
43394
  } else {
43319
- if (w < r * 2) {
43320
- r = w / 2;
43395
+ var _isNegativeValue = h > 0;
43396
+
43397
+ if (_isNegativeValue) {
43398
+ h -= r;
43399
+ ctx.lineTo(x + w, y);
43400
+ ctx.lineTo(x + w, y + h);
43401
+ ctx.arcTo(x + w, y + h + r, x - w + r, y + h + r, r);
43402
+ ctx.arcTo(x, y + h + r, x, y + h, r);
43403
+ ctx.lineTo(x, y);
43404
+ } else {
43405
+ h += r;
43406
+ ctx.lineTo(x + w, y);
43407
+ ctx.lineTo(x + w, y + h);
43408
+ ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
43409
+ ctx.arcTo(x, y + h - r, x, y + h, r);
43410
+ ctx.lineTo(x, y);
43321
43411
  }
43322
-
43323
- h += r;
43324
- ctx.lineTo(x + w, y);
43325
- ctx.lineTo(x + w, y + h);
43326
- ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
43327
- ctx.arcTo(x, y + h - r, x, y + h, r);
43328
- ctx.lineTo(x, y);
43329
43412
  }
43330
43413
 
43331
43414
  ctx.fill();
@@ -45080,6 +45163,7 @@ var scale_Scale = /*#__PURE__*/function () {
45080
45163
  }
45081
45164
  /**
45082
45165
  * With range information, calculate how many labels in axis
45166
+ * linear type은 scale.linear.js에서 처리
45083
45167
  * @param {object} range min/max information
45084
45168
  *
45085
45169
  * @returns {object} steps, interval, min/max graph value
@@ -45288,6 +45372,14 @@ var scale_Scale = /*#__PURE__*/function () {
45288
45372
 
45289
45373
  ctx.beginPath();
45290
45374
  ticks[ix] = axisMinForLabel + ix * stepValue;
45375
+ var isZeroLine = ticks[ix] === 0;
45376
+
45377
+ if (isZeroLine && _this3.zeroLineColor) {
45378
+ ctx.strokeStyle = _this3.zeroLineColor;
45379
+ } else {
45380
+ ctx.strokeStyle = _this3.gridLineColor;
45381
+ }
45382
+
45291
45383
  linePosition = labelCenter + aliasPixel;
45292
45384
  labelText = _this3.getLabelFormat(Math.min(axisMax, ticks[ix]), {
45293
45385
  prev: (_ticks = ticks[ix - 1]) !== null && _ticks !== void 0 ? _ticks : ''
@@ -45393,9 +45485,11 @@ var scale_Scale = /*#__PURE__*/function () {
45393
45485
  }
45394
45486
 
45395
45487
  var mergedPlotBandOpt = lodash_es_defaultsDeep({}, plotBand, PLOT_BAND_OPTION);
45396
- var from = mergedPlotBandOpt.from,
45397
- to = mergedPlotBandOpt.to,
45488
+ var userDefinedFrom = mergedPlotBandOpt.from,
45489
+ userDefinedTo = mergedPlotBandOpt.to,
45398
45490
  labelOpt = mergedPlotBandOpt.label;
45491
+ var from = userDefinedFrom ? Math.max(userDefinedFrom, axisMin) : axisMin;
45492
+ var to = userDefinedTo ? Math.min(userDefinedTo, axisMax) : axisMax;
45399
45493
 
45400
45494
  _this3.setPlotBandStyle(mergedPlotBandOpt);
45401
45495
 
@@ -45403,8 +45497,8 @@ var scale_Scale = /*#__PURE__*/function () {
45403
45497
  var toPos;
45404
45498
 
45405
45499
  if (_this3.type === 'x') {
45406
- fromPos = helpers_canvas.calculateX(from !== null && from !== void 0 ? from : minX, axisMin, axisMax, xArea, minX);
45407
- toPos = helpers_canvas.calculateX(to !== null && to !== void 0 ? to : maxX, axisMin, axisMax, xArea, minX);
45500
+ fromPos = helpers_canvas.calculateX(from, axisMin, axisMax, xArea, minX);
45501
+ toPos = helpers_canvas.calculateX(to, axisMin, axisMax, xArea, minX);
45408
45502
 
45409
45503
  if (fromPos === null || toPos === null) {
45410
45504
  return;
@@ -45412,8 +45506,8 @@ var scale_Scale = /*#__PURE__*/function () {
45412
45506
 
45413
45507
  _this3.drawXPlotBand(fromPos, toPos, minX, maxX, minY, maxY);
45414
45508
  } else {
45415
- fromPos = helpers_canvas.calculateY(from !== null && from !== void 0 ? from : axisMin, axisMin, axisMax, yArea, maxY);
45416
- toPos = helpers_canvas.calculateY(to !== null && to !== void 0 ? to : axisMax, axisMin, axisMax, yArea, maxY);
45509
+ fromPos = helpers_canvas.calculateY(from, axisMin, axisMax, yArea, maxY);
45510
+ toPos = helpers_canvas.calculateY(to, axisMin, axisMax, yArea, maxY);
45417
45511
 
45418
45512
  if (fromPos === null || toPos === null) {
45419
45513
  return;
@@ -45984,6 +46078,7 @@ var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
45984
46078
 
45985
46079
 
45986
46080
 
46081
+
45987
46082
  var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
45988
46083
  _inherits(LinearScale, _Scale);
45989
46084
 
@@ -46022,16 +46117,192 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
46022
46117
  * Calculate interval
46023
46118
  * @param {object} range range information
46024
46119
  *
46025
- * @returns {number} interval
46120
+ * @returns {number} interval (한 칸에 표시할 값의 간격)
46026
46121
  */
46027
46122
 
46028
46123
  }, {
46029
46124
  key: "getInterval",
46030
46125
  value: function getInterval(range) {
46126
+ if (this.interval) return this.interval;
46031
46127
  var max = range.maxValue;
46032
46128
  var min = range.minValue;
46033
- var step = range.maxSteps;
46034
- return this.interval ? this.interval : Math.ceil((max - min) / step);
46129
+ var steps = range.maxSteps; // step이 0이면 interval 계산 불가
46130
+
46131
+ if (!steps || steps <= 0) return 0; // startToZero이고, 최소값이 음수일 경우 0을 반드시 포함
46132
+
46133
+ if (this.startToZero && min < 0) {
46134
+ var totalRange = Math.abs(min) + Math.abs(max); // 비율로 나눔
46135
+
46136
+ var negativeRatio = Math.abs(min) / totalRange;
46137
+ var positiveRatio = Math.abs(max) / totalRange; // 각 방향에 최소 1칸 이상 배정되도록 보장
46138
+
46139
+ var negativeSteps = Math.max(1, Math.round(negativeRatio * steps));
46140
+ var positiveSteps = Math.max(1, steps - negativeSteps); // 다시 합이 steps보다 커질 수도 있으니, 조정
46141
+
46142
+ if (negativeSteps + positiveSteps > steps) {
46143
+ // 가장 큰 쪽에서 하나 줄임
46144
+ if (negativeRatio > positiveRatio) {
46145
+ negativeSteps -= 1;
46146
+ } else {
46147
+ positiveSteps -= 1;
46148
+ }
46149
+ }
46150
+
46151
+ return Math.ceil(Math.max(Math.abs(min) / (negativeSteps || 1), Math.abs(max) / (positiveSteps || 1)));
46152
+ }
46153
+
46154
+ return Math.ceil((max - min) / steps);
46155
+ }
46156
+ /**
46157
+ * With range information, calculate how many labels in axis
46158
+ * @param {object} range min/max information
46159
+ *
46160
+ * @returns {object} steps, interval, min/max graph value
46161
+ */
46162
+
46163
+ }, {
46164
+ key: "calculateSteps",
46165
+ value: function calculateSteps(range) {
46166
+ var maxValue = range.maxValue,
46167
+ minValue = range.minValue;
46168
+ var _range$maxSteps = range.maxSteps,
46169
+ maxSteps = _range$maxSteps === void 0 ? 1 : _range$maxSteps;
46170
+ var interval = this.getInterval(range);
46171
+ var graphMin = 0;
46172
+ var graphMax = 0; // 그래프 최대/최소 값 계산
46173
+
46174
+ if (minValue >= 0) {
46175
+ // 전부 양수
46176
+ graphMin = +minValue;
46177
+ graphMax = Math.ceil(maxValue / interval) * interval;
46178
+ } else if (maxValue >= 0) {
46179
+ // 양수/음수 혼합
46180
+ graphMin = Math.floor(minValue / interval) * interval;
46181
+ graphMax = Math.ceil(maxValue / interval) * interval;
46182
+ } else {
46183
+ // 전부 음수
46184
+ graphMax = +maxValue;
46185
+ graphMin = Math.floor(minValue / interval) * interval;
46186
+ }
46187
+
46188
+ var graphRange = graphMax - graphMin;
46189
+ var numberOfSteps = Math.round(graphRange / interval); // 특수 케이스: 양수 최소값, 최대값이 1일 경우
46190
+
46191
+ if (minValue > 0 && maxValue === 1) {
46192
+ if (!this.decimalPoint) {
46193
+ interval = 1;
46194
+ numberOfSteps = 1;
46195
+ maxSteps = 1;
46196
+ } else if (maxSteps > 2) {
46197
+ interval = 0.2;
46198
+ numberOfSteps = 5;
46199
+ maxSteps = 5;
46200
+ } else {
46201
+ interval = 0.5;
46202
+ numberOfSteps = 2;
46203
+ maxSteps = 2;
46204
+ }
46205
+ } // 최대 스텝 수 조정
46206
+
46207
+
46208
+ while (numberOfSteps > maxSteps) {
46209
+ interval *= 2;
46210
+ numberOfSteps = Math.round(graphRange / interval);
46211
+ interval = Math.ceil(graphRange / numberOfSteps);
46212
+ }
46213
+
46214
+ if (graphRange > numberOfSteps * interval) {
46215
+ interval = Math.ceil(graphRange / numberOfSteps);
46216
+ }
46217
+
46218
+ return {
46219
+ steps: numberOfSteps,
46220
+ interval: interval,
46221
+ graphMin: graphMin,
46222
+ graphMax: graphMax
46223
+ };
46224
+ }
46225
+ /**
46226
+ * Calculate min/max value, label and size information for axis
46227
+ * @param {object} minMax min/max information
46228
+ * @param {object} scrollbarOpt scrollbar option
46229
+ *
46230
+ * @returns {object} min/max value and label
46231
+ */
46232
+
46233
+ }, {
46234
+ key: "calculateScaleRange",
46235
+ value: function calculateScaleRange(minMax, scrollbarOpt) {
46236
+ var _this$labelStyle;
46237
+
46238
+ var maxValue;
46239
+ var minValue;
46240
+ var isDefaultMaxSameAsMin = false;
46241
+ var range = scrollbarOpt !== null && scrollbarOpt !== void 0 && scrollbarOpt.use ? scrollbarOpt === null || scrollbarOpt === void 0 ? void 0 : scrollbarOpt.range : this.range;
46242
+
46243
+ if (Array.isArray(range) && (range === null || range === void 0 ? void 0 : range.length) === 2) {
46244
+ if (this.options.type === 'heatMap') {
46245
+ maxValue = range[1] > +minMax.max ? +minMax.max : range[1];
46246
+ minValue = range[0] < +minMax.min ? +minMax.min : range[0];
46247
+ } else {
46248
+ maxValue = range[1];
46249
+ minValue = range[0];
46250
+ }
46251
+ } else if (typeof range === 'function') {
46252
+ var _range = range(minMax.min, minMax.max);
46253
+
46254
+ var _range2 = _slicedToArray(_range, 2);
46255
+
46256
+ minValue = _range2[0];
46257
+ maxValue = _range2[1];
46258
+ } else {
46259
+ maxValue = minMax.max;
46260
+ minValue = minMax.min;
46261
+ } // autoScaleRatio 적용 케이스
46262
+
46263
+
46264
+ if (this.autoScaleRatio) {
46265
+ var temp = maxValue; // 양수 방향에만 autoScaleRatio 적용
46266
+
46267
+ maxValue = Math.ceil(maxValue * (this.autoScaleRatio + 1));
46268
+
46269
+ if (maxValue > 0 && minValue < 0) {
46270
+ // 양수/음수 혼합 케이스 -- 음수 방향에도 maxValue 증가분만큼 더하기
46271
+ var diff = temp - maxValue;
46272
+ minValue += diff;
46273
+ } else if (maxValue < 0 && minValue < 0) {
46274
+ // 전부 음수 케이스 -- 음수 방향에도 autoScaleRatio 적용
46275
+ minValue = Math.ceil(minValue * (this.autoScaleRatio + 1));
46276
+ }
46277
+ } // 0 기준 축 설정 케이스
46278
+
46279
+
46280
+ if (this.startToZero) {
46281
+ if (minValue > 0) {
46282
+ minValue = 0;
46283
+ }
46284
+
46285
+ if (maxValue < 0) {
46286
+ maxValue = 0;
46287
+ }
46288
+ }
46289
+
46290
+ if (maxValue === minValue) {
46291
+ maxValue += 1;
46292
+ isDefaultMaxSameAsMin = true;
46293
+ }
46294
+
46295
+ var minLabel = this.getLabelFormat(minValue);
46296
+ var maxLabel = this.getLabelFormat(maxValue, {
46297
+ isMaxValueSameAsMin: isDefaultMaxSameAsMin
46298
+ });
46299
+ return {
46300
+ min: minValue,
46301
+ max: maxValue,
46302
+ minLabel: minLabel,
46303
+ maxLabel: maxLabel,
46304
+ size: helpers_util.calcTextSize(maxLabel, helpers_util.getLabelStyle(this.labelStyle), (_this$labelStyle = this.labelStyle) === null || _this$labelStyle === void 0 ? void 0 : _this$labelStyle.padding)
46305
+ };
46035
46306
  }
46036
46307
  }]);
46037
46308
 
@@ -47261,7 +47532,7 @@ var plugins_legend_modules = {
47261
47532
  var useLegendSeries = [];
47262
47533
 
47263
47534
  if (groups) {
47264
- useLegendSeries = groups.slice().reverse().filter(function (sId) {
47535
+ useLegendSeries = groups.filter(function (sId) {
47265
47536
  return _this3.seriesList[sId].showLegend;
47266
47537
  }).map(function (sId) {
47267
47538
  return [sId, _this3.seriesList[sId]];
@@ -47312,9 +47583,8 @@ var plugins_legend_modules = {
47312
47583
  },
47313
47584
 
47314
47585
  /**
47315
- * Adds legends for each group in `groups` array, iterating through each series
47316
- * within the group in reverse order. This ensures the legends align with the series
47317
- * order as displayed in the chart. Only adds series with `showLegend` set to `true`.
47586
+ * Adds legends for each group in `groups` array, iterating through each series within the group.
47587
+ * Only adds series with `showLegend` set to `true`.
47318
47588
  *
47319
47589
  * @param {Array} groups - Array of groups containing series identifiers.
47320
47590
  * @param {Object} seriesList - Object containing all series, keyed by series ID.
@@ -47325,7 +47595,7 @@ var plugins_legend_modules = {
47325
47595
  var _this5 = this;
47326
47596
 
47327
47597
  groups.forEach(function (group) {
47328
- group.slice().reverse().forEach(function (sId) {
47598
+ group.forEach(function (sId) {
47329
47599
  var series = seriesList[sId];
47330
47600
 
47331
47601
  if (series && series.showLegend) {
@@ -50467,6 +50737,15 @@ function inRange(number, start, end) {
50467
50737
 
50468
50738
 
50469
50739
 
50740
+
50741
+
50742
+
50743
+
50744
+
50745
+
50746
+
50747
+
50748
+
50470
50749
 
50471
50750
 
50472
50751
 
@@ -50573,14 +50852,30 @@ var plugins_interaction_modules = {
50573
50852
  }
50574
50853
 
50575
50854
  if (indicator.use && type !== 'pie' && type !== 'scatter' && type !== 'heatMap') {
50576
- _this.drawIndicator(offset, indicator.color);
50855
+ // Use data point position instead of mouse position for indicator when tooltip is enabled
50856
+ var indicatorOffset = offset;
50577
50857
 
50578
50858
  var label = _this.getTimeLabel(offset);
50579
50859
 
50860
+ var useAxisTrigger = tooltip.use && tooltip.trigger === 'axis' && type === 'line';
50861
+
50862
+ if (useAxisTrigger && Object.keys(hitInfo.items).length) {
50863
+ var hitId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
50864
+ var hitItem = hitInfo.items[hitId];
50865
+
50866
+ if (hitItem && hitItem.data && hitItem.data.xp !== undefined && hitItem.data.yp !== undefined) {
50867
+ indicatorOffset = [hitItem.data.xp, hitItem.data.yp];
50868
+ label = _this.data.labels[hitItem.index];
50869
+ }
50870
+ }
50871
+
50872
+ _this.drawIndicator(indicatorOffset, indicator.color);
50873
+
50580
50874
  args.hoveredLabel = {
50581
50875
  horizontal: _this.options.horizontal,
50582
50876
  label: label,
50583
- mousePosition: [e.clientX, e.clientY]
50877
+ mousePosition: [e.clientX, e.clientY],
50878
+ useAxisTrigger: useAxisTrigger
50584
50879
  };
50585
50880
  } else {
50586
50881
  args.hoveredLabel = {
@@ -51440,17 +51735,59 @@ var plugins_interaction_modules = {
51440
51735
  }
51441
51736
  },
51442
51737
 
51738
+ /**
51739
+ * @typedef {object} HitInfo
51740
+ * @property {object} items
51741
+ * @property {string} hitId
51742
+ * @property {object} maxTip
51743
+ * @property {object} maxHighlight
51744
+ */
51745
+
51443
51746
  /**
51444
51747
  * Find graph item on mouse position
51445
51748
  * @param {array} offset return value from getMousePosition()
51446
51749
  *
51447
- * @returns {object} hit item information
51750
+ * @returns {HitInfo} hit item information
51448
51751
  */
51449
51752
  findHitItem: function findHitItem(offset) {
51753
+ var _this4 = this;
51754
+
51450
51755
  var sIds = Object.keys(this.seriesList);
51451
51756
  var items = {};
51452
51757
  var isHorizontal = !!this.options.horizontal;
51453
- var ctx = this.tooltipCtx;
51758
+ var ctx = this.tooltipCtx; // Cache for measureText to avoid repeated calculations
51759
+
51760
+ if (!this._measureTextCache) {
51761
+ this._measureTextCache = new Map();
51762
+ } // Use sliding window cache based on text length to maintain frequently used entries
51763
+
51764
+
51765
+ if (this._measureTextCache.size > 1000) {
51766
+ var entries = Array.from(this._measureTextCache.entries()); // Sort by text length (shorter texts are likely more frequently used)
51767
+
51768
+ entries.sort(function (_ref2, _ref3) {
51769
+ var _ref4 = _slicedToArray(_ref2, 1),
51770
+ keyA = _ref4[0];
51771
+
51772
+ var _ref5 = _slicedToArray(_ref3, 1),
51773
+ keyB = _ref5[0];
51774
+
51775
+ var textA = keyA.split('-')[0];
51776
+ var textB = keyB.split('-')[0];
51777
+ return textA.length - textB.length;
51778
+ }); // Keep the first 500 entries (shorter texts)
51779
+
51780
+ this._measureTextCache.clear();
51781
+
51782
+ entries.slice(0, 500).forEach(function (_ref6) {
51783
+ var _ref7 = _slicedToArray(_ref6, 2),
51784
+ key = _ref7[0],
51785
+ value = _ref7[1];
51786
+
51787
+ _this4._measureTextCache.set(key, value);
51788
+ });
51789
+ }
51790
+
51454
51791
  var hitId = null;
51455
51792
  var maxs = '';
51456
51793
  var maxsw = 0;
@@ -51460,64 +51797,81 @@ var plugins_interaction_modules = {
51460
51797
 
51461
51798
  for (var ix = 0; ix < sIds.length; ix++) {
51462
51799
  var sId = sIds[ix];
51463
- var series = this.seriesList[sId];
51800
+ var series = this.seriesList[sId]; // Skip hidden series for performance
51464
51801
 
51465
- if (series.findGraphData) {
51466
- var item = series.findGraphData(offset, isHorizontal);
51802
+ if (!series.show || !series.findGraphData) {
51803
+ // eslint-disable-next-line no-continue
51804
+ continue;
51805
+ }
51467
51806
 
51468
- if (item !== null && item !== void 0 && item.data) {
51469
- var gdata = void 0;
51807
+ var item = series.findGraphData(offset, isHorizontal);
51470
51808
 
51471
- if (item.data.o === null && series.interpolation !== 'zero') {
51472
- if (!series.isExistGrp) {
51473
- gdata = isHorizontal ? item.data.x : item.data.y;
51474
- }
51475
- } else if (!isNaN(item.data.o)) {
51476
- gdata = item.data.o;
51809
+ if (item !== null && item !== void 0 && item.data) {
51810
+ var gdata = void 0;
51811
+
51812
+ if (item.data.o === null && series.interpolation !== 'zero') {
51813
+ if (!series.isExistGrp) {
51814
+ gdata = isHorizontal ? item.data.x : item.data.y;
51477
51815
  }
51816
+ } else if (!isNaN(item.data.o)) {
51817
+ gdata = item.data.o;
51818
+ }
51478
51819
 
51479
- if (gdata !== null && gdata !== undefined) {
51480
- var formattedSeriesName = this.getFormattedTooltipLabel({
51481
- dataId: series.id,
51482
- seriesId: sId,
51483
- seriesName: series.name,
51484
- itemData: item.data
51485
- });
51486
- var sw = ctx ? ctx.measureText(formattedSeriesName).width : 1;
51487
- item.id = series.id;
51488
- item.name = formattedSeriesName;
51489
- item.axis = {
51490
- x: series.xAxisIndex,
51491
- y: series.yAxisIndex
51492
- };
51493
- items[sId] = item;
51494
- var formattedTxt = this.getFormattedTooltipValue({
51495
- dataId: series.id,
51496
- seriesId: sId,
51497
- seriesName: formattedSeriesName,
51498
- value: gdata,
51499
- itemData: item.data
51500
- });
51501
- item.data.formatted = formattedTxt;
51820
+ if (gdata !== null && gdata !== undefined) {
51821
+ var formattedSeriesName = this.getFormattedTooltipLabel({
51822
+ dataId: series.id,
51823
+ seriesId: sId,
51824
+ seriesName: series.name,
51825
+ itemData: item.data
51826
+ }); // Use cached measureText for better performance
51502
51827
 
51503
- if (maxsw < sw) {
51504
- maxs = formattedSeriesName;
51505
- maxsw = sw;
51506
- }
51828
+ var sw = 1;
51507
51829
 
51508
- if (maxv.length <= "".concat(formattedTxt).length) {
51509
- maxv = "".concat(formattedTxt);
51510
- }
51830
+ if (ctx) {
51831
+ var cacheKey = "".concat(formattedSeriesName, "-").concat(ctx.font);
51511
51832
 
51512
- if (maxg === null || maxg <= gdata) {
51513
- maxg = gdata;
51514
- maxSID = sId;
51515
- }
51833
+ if (this._measureTextCache.has(cacheKey)) {
51834
+ sw = this._measureTextCache.get(cacheKey);
51835
+ } else {
51836
+ sw = ctx.measureText(formattedSeriesName).width;
51516
51837
 
51517
- if (item.hit) {
51518
- hitId = sId;
51838
+ this._measureTextCache.set(cacheKey, sw);
51519
51839
  }
51520
51840
  }
51841
+
51842
+ item.id = series.id;
51843
+ item.name = formattedSeriesName;
51844
+ item.axis = {
51845
+ x: series.xAxisIndex,
51846
+ y: series.yAxisIndex
51847
+ };
51848
+ items[sId] = item;
51849
+ var formattedTxt = this.getFormattedTooltipValue({
51850
+ dataId: series.id,
51851
+ seriesId: sId,
51852
+ seriesName: formattedSeriesName,
51853
+ value: gdata,
51854
+ itemData: item.data
51855
+ });
51856
+ item.data.formatted = formattedTxt;
51857
+
51858
+ if (maxsw < sw) {
51859
+ maxs = formattedSeriesName;
51860
+ maxsw = sw;
51861
+ }
51862
+
51863
+ if (maxv.length <= "".concat(formattedTxt).length) {
51864
+ maxv = "".concat(formattedTxt);
51865
+ }
51866
+
51867
+ if (maxg === null || maxg <= gdata) {
51868
+ maxg = gdata;
51869
+ maxSID = sId;
51870
+ }
51871
+
51872
+ if (item.hit) {
51873
+ hitId = sId;
51874
+ }
51521
51875
  }
51522
51876
  }
51523
51877
  }
@@ -51540,13 +51894,13 @@ var plugins_interaction_modules = {
51540
51894
  * @param itemData
51541
51895
  * @returns {string}
51542
51896
  */
51543
- getFormattedTooltipLabel: function getFormattedTooltipLabel(_ref2) {
51897
+ getFormattedTooltipLabel: function getFormattedTooltipLabel(_ref8) {
51544
51898
  var _tooltipOpt$formatter;
51545
51899
 
51546
- var dataId = _ref2.dataId,
51547
- seriesId = _ref2.seriesId,
51548
- seriesName = _ref2.seriesName,
51549
- itemData = _ref2.itemData;
51900
+ var dataId = _ref8.dataId,
51901
+ seriesId = _ref8.seriesId,
51902
+ seriesName = _ref8.seriesName,
51903
+ itemData = _ref8.itemData;
51550
51904
  var opt = this.options;
51551
51905
  var tooltipOpt = opt.tooltip;
51552
51906
  var tooltipLabelFormatter = tooltipOpt === null || tooltipOpt === void 0 ? void 0 : (_tooltipOpt$formatter = tooltipOpt.formatter) === null || _tooltipOpt$formatter === void 0 ? void 0 : _tooltipOpt$formatter.label;
@@ -51573,14 +51927,14 @@ var plugins_interaction_modules = {
51573
51927
  * @param itemData
51574
51928
  * @returns {string}
51575
51929
  */
51576
- getFormattedTooltipValue: function getFormattedTooltipValue(_ref3) {
51930
+ getFormattedTooltipValue: function getFormattedTooltipValue(_ref9) {
51577
51931
  var _tooltipOpt$formatter2;
51578
51932
 
51579
- var dataId = _ref3.dataId,
51580
- seriesId = _ref3.seriesId,
51581
- seriesName = _ref3.seriesName,
51582
- value = _ref3.value,
51583
- itemData = _ref3.itemData;
51933
+ var dataId = _ref9.dataId,
51934
+ seriesId = _ref9.seriesId,
51935
+ seriesName = _ref9.seriesName,
51936
+ value = _ref9.value,
51937
+ itemData = _ref9.itemData;
51584
51938
  var opt = this.options;
51585
51939
  var isHorizontal = !!opt.horizontal;
51586
51940
  var tooltipOpt = opt.tooltip;
@@ -51753,7 +52107,7 @@ var plugins_interaction_modules = {
51753
52107
  * @returns {object[]}
51754
52108
  */
51755
52109
  getSelectedLabelInfoWithLabelData: function getSelectedLabelInfoWithLabelData(labelIndexList, targetAxis) {
51756
- var _this4 = this;
52110
+ var _this5 = this;
51757
52111
 
51758
52112
  var _this$options9 = this.options,
51759
52113
  selectLabelOpt = _this$options9.selectLabel,
@@ -51769,14 +52123,14 @@ var plugins_interaction_modules = {
51769
52123
  {
51770
52124
  result.dataIndex.splice(selectLabelOpt.limit);
51771
52125
  result.label = result.dataIndex.map(function (i) {
51772
- return _this4.data.labels[i];
52126
+ return _this5.data.labels[i];
51773
52127
  });
51774
52128
  var dataEntries = Object.entries(this.data.data);
51775
52129
  result.data = result.dataIndex.map(function (labelIdx) {
51776
- return Object.fromEntries(dataEntries.map(function (_ref4) {
51777
- var _ref5 = _slicedToArray(_ref4, 2),
51778
- sId = _ref5[0],
51779
- data = _ref5[1];
52130
+ return Object.fromEntries(dataEntries.map(function (_ref10) {
52131
+ var _ref11 = _slicedToArray(_ref10, 2),
52132
+ sId = _ref11[0],
52133
+ data = _ref11[1];
51780
52134
 
51781
52135
  return [sId, data[labelIdx]];
51782
52136
  }));
@@ -51799,12 +52153,12 @@ var plugins_interaction_modules = {
51799
52153
  }
51800
52154
 
51801
52155
  result.label = result.dataIndex.map(function (i) {
51802
- return _this4.data.labels[targetAxisDirection][i];
52156
+ return _this5.data.labels[targetAxisDirection][i];
51803
52157
  });
51804
52158
  var dataValues = Object.values(this.data.data)[0];
51805
- result.data = dataValues.filter(function (_ref6) {
51806
- var x = _ref6.x,
51807
- y = _ref6.y;
52159
+ result.data = dataValues.filter(function (_ref12) {
52160
+ var x = _ref12.x,
52161
+ y = _ref12.y;
51808
52162
  return result.label.includes(targetAxisDirection === 'y' ? y : x);
51809
52163
  });
51810
52164
  break;
@@ -51927,14 +52281,14 @@ var plugins_interaction_modules = {
51927
52281
  * object.range: coordinate-based range in graph
51928
52282
  * @returns {object}
51929
52283
  */
51930
- getSelectionRange: function getSelectionRange(_ref7) {
52284
+ getSelectionRange: function getSelectionRange(_ref13) {
51931
52285
  var _this$boxOverflow, _this$boxOverflow2, _this$boxOverflow3, _this$boxOverflow4;
51932
52286
 
51933
- var xsp = _ref7.xsp,
51934
- ysp = _ref7.ysp,
51935
- width = _ref7.width,
51936
- height = _ref7.height,
51937
- range = _ref7.range;
52287
+ var xsp = _ref13.xsp,
52288
+ ysp = _ref13.ysp,
52289
+ width = _ref13.width,
52290
+ height = _ref13.height,
52291
+ range = _ref13.range;
51938
52292
  var dataRangeX = this.axesSteps.x.length ? this.axesSteps.x[0] : null;
51939
52293
  var dataRangeY = this.axesSteps.y.length ? this.axesSteps.y[0] : null;
51940
52294
 
@@ -51991,11 +52345,11 @@ var plugins_interaction_modules = {
51991
52345
 
51992
52346
  var sId = Object.keys(this.seriesList)[0];
51993
52347
 
51994
- var _ref8 = (_this$seriesList$sId$ = this.seriesList[sId].findSelectionRange(range)) !== null && _this$seriesList$sId$ !== void 0 ? _this$seriesList$sId$ : {},
51995
- xMin = _ref8.xMin,
51996
- xMax = _ref8.xMax,
51997
- yMin = _ref8.yMin,
51998
- yMax = _ref8.yMax;
52348
+ var _ref14 = (_this$seriesList$sId$ = this.seriesList[sId].findSelectionRange(range)) !== null && _this$seriesList$sId$ !== void 0 ? _this$seriesList$sId$ : {},
52349
+ xMin = _ref14.xMin,
52350
+ xMax = _ref14.xMax,
52351
+ yMin = _ref14.yMin,
52352
+ yMax = _ref14.yMax;
51999
52353
 
52000
52354
  return {
52001
52355
  xMin: xMin !== null && xMin !== void 0 ? xMin : dataRangeX.graphMin,
@@ -52085,6 +52439,7 @@ var plugins_interaction_modules = {
52085
52439
 
52086
52440
 
52087
52441
 
52442
+
52088
52443
  var LINE_SPACING = 8;
52089
52444
  var VALUE_MARGIN = 50;
52090
52445
  var SCROLL_WIDTH = 17;
@@ -52875,7 +53230,7 @@ var plugins_tooltip_modules = {
52875
53230
  y1: this.chartRect.y1 + this.labelOffset.top,
52876
53231
  y2: this.chartRect.y2 - this.labelOffset.bottom
52877
53232
  };
52878
- var mouseXIp = 1; // mouseInterpolation
53233
+ var mouseXIp = 5; // mouseInterpolation - increased for better edge detection
52879
53234
 
52880
53235
  var mouseYIp = 10;
52881
53236
  var options = this.options;
@@ -52971,7 +53326,8 @@ var plugins_tooltip_modules = {
52971
53326
 
52972
53327
  var horizontal = _ref5.horizontal,
52973
53328
  label = _ref5.label,
52974
- mousePosition = _ref5.mousePosition;
53329
+ mousePosition = _ref5.mousePosition,
53330
+ useAxisTrigger = _ref5.useAxisTrigger;
52975
53331
 
52976
53332
  if (!mousePosition || !!horizontal !== !!this.options.horizontal) {
52977
53333
  return;
@@ -53018,7 +53374,25 @@ var plugins_tooltip_modules = {
53018
53374
  y2: this.chartRect.y2 - this.labelOffset.bottom
53019
53375
  };
53020
53376
 
53021
- if (horizontal) {
53377
+ if (useAxisTrigger && label) {
53378
+ var _this$data$labels5;
53379
+
53380
+ var matchIndex = (_this$data$labels5 = this.data.labels) === null || _this$data$labels5 === void 0 ? void 0 : _this$data$labels5.findIndex(function (l) {
53381
+ return (l === null || l === void 0 ? void 0 : l.valueOf()) === (label === null || label === void 0 ? void 0 : label.valueOf());
53382
+ });
53383
+
53384
+ if (matchIndex >= 0) {
53385
+ var _Object$keys, _this$seriesList, _this$seriesList$seri, _this$seriesList$seri2;
53386
+
53387
+ var seriesId = (_Object$keys = Object.keys(this.seriesList)) === null || _Object$keys === void 0 ? void 0 : _Object$keys[0];
53388
+ 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];
53389
+
53390
+ if ((dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.xp) !== undefined && (dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.xp) !== null) {
53391
+ var yPosition = !lodash_es_isNil(dataPoint.yp) ? dataPoint.yp : (graphPos.y1 + graphPos.y2) / 2;
53392
+ this.drawIndicator([dataPoint.xp, yPosition], this.options.indicator.color);
53393
+ }
53394
+ }
53395
+ } else if (horizontal) {
53022
53396
  var chartHeight = graphPos.y2 - graphPos.y1;
53023
53397
  var offsetY = chartHeight * (label - fromTime) / (toTime - fromTime) + graphPos.y1;
53024
53398
  this.drawIndicator([graphPos.x2, offsetY], this.options.indicator.color);
@@ -53369,7 +53743,6 @@ var plugins_pie_modules = {
53369
53743
 
53370
53744
 
53371
53745
 
53372
-
53373
53746
  var element_tip_modules = {
53374
53747
  /**
53375
53748
  * Draw TextTip with tip's locationInfo
@@ -53403,8 +53776,7 @@ var element_tip_modules = {
53403
53776
  }
53404
53777
 
53405
53778
  if (labelTipOpt.use && labelTipOpt.showTip) {
53406
- var isHeatMap = opt.type === 'heatMap';
53407
- isExistSelectedLabel = isHeatMap ? this.drawLabelTipForHeatMap() : this.drawLabelTip();
53779
+ isExistSelectedLabel = opt.type === 'heatMap' ? this.drawLabelTipForHeatMap() : this.drawTipForSelectedLabel();
53408
53780
  }
53409
53781
 
53410
53782
  var executeDrawIndicator = function executeDrawIndicator(tipOpt) {
@@ -53690,9 +54062,10 @@ var element_tip_modules = {
53690
54062
 
53691
54063
  /**
53692
54064
  * Draw Selected Label Tip
54065
+ * none Text
53693
54066
  * @returns {boolean} Whether drew at least one tip
53694
54067
  */
53695
- drawLabelTip: function drawLabelTip() {
54068
+ drawTipForSelectedLabel: function drawTipForSelectedLabel() {
53696
54069
  var _this2 = this;
53697
54070
 
53698
54071
  var opt = this.options;
@@ -53718,7 +54091,7 @@ var element_tip_modules = {
53718
54091
  };
53719
54092
  var labelAxes = isHorizontal ? this.axesY[0] : this.axesX[0];
53720
54093
  var valueAxes = isHorizontal ? this.axesX[0] : this.axesY[0];
53721
- var valueAxesRange = isHorizontal ? this.axesRange.x[0] : this.axesRange.y[0];
54094
+ var valueAxesSteps = isHorizontal ? this.axesSteps.x[0] : this.axesSteps.y[0];
53722
54095
  var valuePositionCalcFunction = isHorizontal ? helpers_canvas.calculateX : helpers_canvas.calculateY;
53723
54096
  var labelPositionCalcFunction = isHorizontal ? helpers_canvas.calculateY : helpers_canvas.calculateX;
53724
54097
  var scrollbarOpt = isHorizontal ? this.scrollbar.y : this.scrollbar.x;
@@ -53736,8 +54109,8 @@ var element_tip_modules = {
53736
54109
  return _this2.seriesList[sId].isExistGrp && !_this2.seriesList[sId].isOverlapping;
53737
54110
  });
53738
54111
  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$ : [];
53739
- var gp;
53740
- var dp;
54112
+ var labelPos;
54113
+ var dataPos;
53741
54114
  var value;
53742
54115
  var labelStartPoint;
53743
54116
  var labelEndPoint;
@@ -53785,31 +54158,39 @@ var element_tip_modules = {
53785
54158
  }
53786
54159
 
53787
54160
  data.forEach(function (selectedData, i) {
53788
- if (labelTipOpt.fixedPosTop) {
53789
- value = valueAxesRange.max;
53790
- } else if (isExistGrp) {
53791
- var sumValue = visibleSeries.reduce(function (ac, sId) {
53792
- var _selectedData$sId$val, _selectedData$sId;
53793
-
53794
- return groups.includes(sId) ? ac + ((_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]) : ac;
53795
- }, 0);
53796
- var nonGroupValues = visibleSeries.filter(function (sId) {
53797
- return !groups.includes(sId);
53798
- }).map(function (sId) {
53799
- var _selectedData$sId$val2, _selectedData$sId2;
53800
-
53801
- return (_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];
53802
- });
53803
- value = Math.max.apply(Math, _toConsumableArray(nonGroupValues).concat([sumValue]));
53804
- } else if (visibleSeries.length) {
53805
- var visibleValue = visibleSeries.map(function (sId) {
53806
- var _selectedData$sId$val3, _selectedData$sId3;
53807
-
53808
- 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];
53809
- });
53810
- value = Math.max.apply(Math, _toConsumableArray(visibleValue));
53811
- } else {
53812
- value = valueAxesRange.max;
54161
+ value = valueAxesSteps.graphMax;
54162
+
54163
+ if (!labelTipOpt.fixedPosTop) {
54164
+ if (isExistGrp) {
54165
+ var _visibleSeries$filter, _visibleSeries$filter2;
54166
+
54167
+ var positiveSum = visibleSeries === null || visibleSeries === void 0 ? void 0 : visibleSeries.reduce(function (ac, sId) {
54168
+ var _selectedData$sId$val, _selectedData$sId, _selectedData$sId$val2, _selectedData$sId2;
54169
+
54170
+ 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;
54171
+ }, 0);
54172
+ var nonGroupValues = (_visibleSeries$filter = visibleSeries === null || visibleSeries === void 0 ? void 0 : (_visibleSeries$filter2 = visibleSeries.filter(function (sId) {
54173
+ return !groups.includes(sId);
54174
+ })) === null || _visibleSeries$filter2 === void 0 ? void 0 : _visibleSeries$filter2.map(function (sId) {
54175
+ var _selectedData$sId$val3, _selectedData$sId3;
54176
+
54177
+ 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];
54178
+ })) !== null && _visibleSeries$filter !== void 0 ? _visibleSeries$filter : [];
54179
+ var maxNonGroupValue = (nonGroupValues === null || nonGroupValues === void 0 ? void 0 : nonGroupValues.length) > 0 ? nonGroupValues.reduce(function (max, val) {
54180
+ return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
54181
+ }, -Infinity) : -Infinity;
54182
+ value = positiveSum > 0 ? Math.max(maxNonGroupValue, positiveSum) : Math.max(maxNonGroupValue, 0);
54183
+ } else if (visibleSeries.length) {
54184
+ var visibleValue = visibleSeries.map(function (sId) {
54185
+ var _selectedData$sId$val4, _selectedData$sId4;
54186
+
54187
+ 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];
54188
+ });
54189
+ var maxValue = visibleValue.length > 0 ? visibleValue.reduce(function (max, val) {
54190
+ return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
54191
+ }, -Infinity) : -Infinity;
54192
+ value = maxValue > 0 || _this2.options.type !== 'bar' ? maxValue : 0;
54193
+ }
53813
54194
  }
53814
54195
 
53815
54196
  if (labelAxes.labels) {
@@ -53819,18 +54200,17 @@ var element_tip_modules = {
53819
54200
 
53820
54201
  var labelIndex = dataIndex[i] - startIndex;
53821
54202
  var labelCenter = Math.round(labelStartPoint + labelGap * labelIndex);
53822
- dp = labelCenter + labelGap / 2;
54203
+ labelPos = labelCenter + labelGap / 2;
53823
54204
  } else {
53824
- dp = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
54205
+ labelPos = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
53825
54206
  }
53826
54207
 
53827
- gp = valuePositionCalcFunction(value, valueAxesRange.min, valueAxesRange.max, valueSpace, valueStartPoint);
53828
- gp += offset;
54208
+ dataPos = valuePositionCalcFunction(value, valueAxesSteps.graphMin, valueAxesSteps.graphMax, valueSpace, valueStartPoint) + offset;
53829
54209
 
53830
54210
  _this2.showTip({
53831
54211
  context: _this2.bufferCtx,
53832
- x: isHorizontal ? gp : dp,
53833
- y: isHorizontal ? dp : gp,
54212
+ x: isHorizontal ? dataPos : labelPos,
54213
+ y: isHorizontal ? labelPos : dataPos,
53834
54214
  opt: labelTipOpt,
53835
54215
  isSamePos: false
53836
54216
  });
@@ -53942,10 +54322,11 @@ var element_tip_modules = {
53942
54322
  }
53943
54323
  } else if (isHorizontal) {
53944
54324
  gp = helpers_canvas.calculateX(value, graphX.graphMin, graphX.graphMax, xArea, xsp);
53945
- gp += offset;
54325
+ gp = value < 0 ? gp - offset : gp + offset;
53946
54326
  } else {
53947
- gp = helpers_canvas.calculateY(value, graphY.graphMin, graphY.graphMax, yArea, ysp);
53948
- gp -= offset;
54327
+ var adjustedValue = type === 'bar' && value < 0 ? 0 : value;
54328
+ gp = helpers_canvas.calculateY(adjustedValue, graphY.graphMin, graphY.graphMax, yArea, ysp);
54329
+ gp = adjustedValue < 0 ? gp + offset : gp - offset;
53949
54330
  }
53950
54331
 
53951
54332
  var maxTipType = 'center';
@@ -53977,7 +54358,8 @@ var element_tip_modules = {
53977
54358
  arrowSize: arrowSize,
53978
54359
  borderRadius: borderRadius,
53979
54360
  text: text,
53980
- textStyle: textStyle
54361
+ textStyle: textStyle,
54362
+ isNegative: value < 0
53981
54363
  });
53982
54364
  }
53983
54365
 
@@ -54011,12 +54393,21 @@ var element_tip_modules = {
54011
54393
  borderRadius = param.borderRadius,
54012
54394
  text = param.text,
54013
54395
  opt = param.opt,
54014
- textStyle = param.textStyle;
54396
+ textStyle = param.textStyle,
54397
+ isNegative = param.isNegative;
54015
54398
  var ctx = param.context;
54016
54399
  var sx = x - width / 2;
54017
54400
  var ex = x + width / 2;
54018
54401
  var sy = y - height;
54019
54402
  var ey = y;
54403
+
54404
+ if (isNegative) {
54405
+ if (isHorizontal) {
54406
+ sx = x - width / 2 - width;
54407
+ ex = x - width / 2;
54408
+ }
54409
+ }
54410
+
54020
54411
  ctx.save();
54021
54412
  ctx.font = textStyle;
54022
54413
  ctx.fillStyle = (_opt$tipBackground = opt.tipBackground) !== null && _opt$tipBackground !== void 0 ? _opt$tipBackground : opt.tipStyle.background;
@@ -54024,44 +54415,73 @@ var element_tip_modules = {
54024
54415
  ctx.beginPath();
54025
54416
  ctx.moveTo(sx + borderRadius, sy);
54026
54417
  ctx.quadraticCurveTo(sx, sy, sx, sy + borderRadius);
54027
-
54028
- if (isHorizontal) {
54029
- ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
54030
- ctx.lineTo(sx - arrowSize, ey - height / 2);
54031
- ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
54032
- }
54033
-
54034
54418
  ctx.lineTo(sx, ey - borderRadius);
54035
54419
  ctx.quadraticCurveTo(sx, ey, sx + borderRadius, ey);
54036
-
54037
- if (!isHorizontal) {
54038
- if (type === 'left') {
54039
- ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
54040
- ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
54041
- } else if (type === 'right') {
54042
- ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
54043
- ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
54044
- } else {
54045
- ctx.lineTo(x - arrowSize, ey);
54046
- ctx.lineTo(x, ey + arrowSize);
54047
- ctx.lineTo(x + arrowSize, ey);
54048
- }
54049
- }
54050
-
54051
54420
  ctx.lineTo(ex - borderRadius, ey);
54052
54421
  ctx.quadraticCurveTo(ex, ey, ex, ey - borderRadius);
54053
54422
  ctx.lineTo(ex, sy + borderRadius);
54054
54423
  ctx.quadraticCurveTo(ex, sy, ex - borderRadius, sy);
54055
54424
  ctx.lineTo(sx + borderRadius, sy);
54056
54425
  ctx.closePath();
54057
- ctx.fill();
54426
+ ctx.fill(); // draw arrow
54427
+
54428
+ ctx.beginPath();
54429
+
54430
+ if (isHorizontal) {
54431
+ if (isNegative) {
54432
+ ctx.moveTo(ex, ey);
54433
+ ctx.lineTo(ex, sy + borderRadius + arrowSize / 2);
54434
+ ctx.lineTo(ex + arrowSize, ey - height / 2);
54435
+ ctx.lineTo(ex, ey - borderRadius - arrowSize / 2);
54436
+ } else {
54437
+ ctx.moveTo(sx, sy);
54438
+ ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
54439
+ ctx.lineTo(sx - arrowSize, ey - height / 2);
54440
+ ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
54441
+ }
54442
+
54443
+ ctx.closePath();
54444
+ ctx.fill();
54445
+ } else {
54446
+ if (isNegative) {
54447
+ if (type === 'left') {
54448
+ ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
54449
+ ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
54450
+ } else if (type === 'right') {
54451
+ ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
54452
+ ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
54453
+ } else {
54454
+ ctx.lineTo(x - arrowSize, ey);
54455
+ ctx.lineTo(x, ey + arrowSize);
54456
+ ctx.lineTo(x + arrowSize, ey);
54457
+ }
54458
+ } else if (!isNegative) {
54459
+ if (type === 'left') {
54460
+ ctx.moveTo(sx, sy);
54461
+ ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
54462
+ ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
54463
+ } else if (type === 'right') {
54464
+ ctx.moveTo(ex, sy);
54465
+ ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
54466
+ ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
54467
+ } else {
54468
+ ctx.lineTo(x - arrowSize, ey);
54469
+ ctx.lineTo(x, ey + arrowSize);
54470
+ ctx.lineTo(x + arrowSize, ey);
54471
+ }
54472
+ }
54473
+
54474
+ ctx.closePath();
54475
+ ctx.fill();
54476
+ }
54477
+
54058
54478
  ctx.restore();
54059
54479
  ctx.save();
54060
54480
  ctx.font = textStyle;
54061
54481
  ctx.fillStyle = (_opt$tipTextColor = opt.tipTextColor) !== null && _opt$tipTextColor !== void 0 ? _opt$tipTextColor : opt.tipStyle.textColor;
54062
54482
  ctx.textBaseline = 'middle';
54063
54483
  ctx.textAlign = 'center';
54064
- ctx.fillText("".concat(text), x, sy + height / 2);
54484
+ ctx.fillText("".concat(text), sx + width / 2, sy + height / 2);
54065
54485
  ctx.restore();
54066
54486
  },
54067
54487
 
@@ -54313,11 +54733,13 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54313
54733
  value: function drawSyncedIndicator(_ref) {
54314
54734
  var horizontal = _ref.horizontal,
54315
54735
  label = _ref.label,
54316
- mousePosition = _ref.mousePosition;
54736
+ mousePosition = _ref.mousePosition,
54737
+ useAxisTrigger = _ref.useAxisTrigger;
54317
54738
  this.drawSyncedIndicator({
54318
54739
  horizontal: horizontal,
54319
54740
  label: label,
54320
- mousePosition: mousePosition
54741
+ mousePosition: mousePosition,
54742
+ useAxisTrigger: useAxisTrigger
54321
54743
  });
54322
54744
  }
54323
54745
  }, {
@@ -56145,6 +56567,7 @@ var DEFAULT_OPTIONS = {
56145
56567
  combo: false,
56146
56568
  tooltip: {
56147
56569
  use: true,
56570
+ trigger: 'axis',
56148
56571
  sortByValue: true,
56149
56572
  backgroundColor: '#4C4C4C',
56150
56573
  fontColor: '#FFFFFF',