evui 3.4.129 → 3.4.131

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.
@@ -11174,7 +11174,7 @@ module.exports = exports;
11174
11174
  /***/ "9224":
11175
11175
  /***/ (function(module) {
11176
11176
 
11177
- module.exports = JSON.parse("{\"a\":\"3.4.129\"}");
11177
+ module.exports = JSON.parse("{\"a\":\"3.4.131\"}");
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 isNegative = value < 0;
38507
- var absValue = Math.abs(value);
38508
-
38509
38506
  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');
38507
+ if (v % target === 0) {
38508
+ return "".concat((v / target).toFixed(decimalPoint)).concat(lb);
38509
+ }
38510
+
38511
+ return "".concat((v / target).toFixed(1)).concat(lb);
38512
+ };
38513
+
38514
+ if (value >= quad) {
38515
+ label = assignLabelWith(value, quad, 'P');
38516
+ } else if (value >= trill) {
38517
+ label = assignLabelWith(value, trill, 'T');
38518
+ } else if (value >= billi) {
38519
+ label = assignLabelWith(value, billi, 'G');
38520
+ } else if (value >= milli) {
38521
+ label = assignLabelWith(value, milli, 'M');
38522
+ } else if (value >= killo) {
38523
+ label = assignLabelWith(value, 1000, 'K');
38524
38524
  } else {
38525
- label = isNegative ? "-".concat(absValue.toFixed(decimalPoint)) : value.toFixed(decimalPoint);
38525
+ label = value.toFixed(decimalPoint);
38526
38526
  }
38527
38527
 
38528
38528
  return label;
@@ -38796,23 +38796,21 @@ 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;
38800
38799
 
38801
38800
  if (series && sData) {
38802
38801
  series.data = _this.addSeriesDSforScatter(sData);
38803
- series.minMax = _this.getSeriesMinMax(series.data, passingValue);
38802
+ series.minMax = _this.getSeriesMinMax(series.data);
38804
38803
  }
38805
38804
  });
38806
38805
  } else if (typeKey === 'heatMap') {
38807
38806
  seriesIDs.forEach(function (seriesID) {
38808
38807
  var series = _this.seriesList[seriesID];
38809
- var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
38810
38808
  var sData = data[seriesID];
38811
38809
 
38812
38810
  if (series && sData) {
38813
38811
  series.labels = label;
38814
38812
  series.data = _this.addSeriesDSForHeatMap(sData);
38815
- series.minMax = _this.getSeriesMinMax(series.data, passingValue);
38813
+ series.minMax = _this.getSeriesMinMax(series.data);
38816
38814
  series.valueOpt = _this.getSeriesValueOptForHeatMap(series);
38817
38815
  }
38818
38816
  });
@@ -38844,7 +38842,7 @@ var modules = {
38844
38842
  series.data = _this.addSeriesDS(sData, label, series.isExistGrp);
38845
38843
  }
38846
38844
 
38847
- series.minMax = _this.getSeriesMinMax(series.data, series.passingValue);
38845
+ series.minMax = _this.getSeriesMinMax(series.data);
38848
38846
  }
38849
38847
  });
38850
38848
  }
@@ -39240,19 +39238,17 @@ var modules = {
39240
39238
  var isHorizontal = this.options.horizontal;
39241
39239
  var sdata = [];
39242
39240
 
39243
- var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex, curr) {
39241
+ var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex) {
39244
39242
  var nextBaseSeriesIndex = baseIndex - 1;
39245
39243
  var baseSeries = _this4.seriesList[bsIds[baseIndex]];
39246
39244
  var baseDataList = baseSeries.data;
39247
39245
  var baseData = baseDataList[dataIndex];
39248
39246
  var position = isHorizontal ? baseData === null || baseData === void 0 ? void 0 : baseData.x : baseData === null || baseData === void 0 ? void 0 : baseData.y;
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;
39247
+ var isPassingValue = baseSeries.passingValue === (baseData === null || baseData === void 0 ? void 0 : baseData.o);
39252
39248
 
39253
- if (isPassingValue || position == null || !isSameSign || !baseSeries.show) {
39249
+ if (isPassingValue || position == null || !baseSeries.show) {
39254
39250
  if (nextBaseSeriesIndex > -1) {
39255
- return getBaseDataPosition(nextBaseSeriesIndex, dataIndex, curr);
39251
+ return getBaseDataPosition(nextBaseSeriesIndex, dataIndex);
39256
39252
  }
39257
39253
 
39258
39254
  return 0;
@@ -39263,7 +39259,7 @@ var modules = {
39263
39259
 
39264
39260
  data.forEach(function (curr, index) {
39265
39261
  var baseIndex = bsIds.length - 1 < 0 ? 0 : bsIds.length - 1;
39266
- var bdata = getBaseDataPosition(baseIndex, index, curr); // base(previous) series data
39262
+ var bdata = getBaseDataPosition(baseIndex, index); // base(previous) series data
39267
39263
 
39268
39264
  var odata = curr; // current series original data
39269
39265
 
@@ -39446,7 +39442,7 @@ var modules = {
39446
39442
  *
39447
39443
  * @returns {object} min/max info for series
39448
39444
  */
39449
- getSeriesMinMax: function getSeriesMinMax(data, passingValue) {
39445
+ getSeriesMinMax: function getSeriesMinMax(data) {
39450
39446
  var def = {
39451
39447
  minX: null,
39452
39448
  minY: null,
@@ -39457,24 +39453,22 @@ var modules = {
39457
39453
  var isHorizontal = this.options.horizontal;
39458
39454
 
39459
39455
  if (data.length) {
39460
- var usePassingValue = !helpers_util.isNullOrUndefined(passingValue);
39461
39456
  return data.reduce(function (acc, p, index) {
39462
- var _p$x, _p$y, _p$o;
39457
+ var _p$x, _p$y;
39463
39458
 
39464
39459
  var minmax = acc;
39465
39460
  var px = ((_p$x = p.x) === null || _p$x === void 0 ? void 0 : _p$x.value) || p.x;
39466
39461
  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;
39468
39462
 
39469
- if (usePassingValue ? po !== passingValue && px <= minmax.minX : px <= minmax.minX) {
39463
+ if (px <= minmax.minX) {
39470
39464
  minmax.minX = px === null ? 0 : px;
39471
39465
  }
39472
39466
 
39473
- if (usePassingValue ? po !== passingValue && py <= minmax.minY : py <= minmax.minY) {
39467
+ if (py <= minmax.minY) {
39474
39468
  minmax.minY = py === null ? 0 : py;
39475
39469
  }
39476
39470
 
39477
- if (usePassingValue ? po !== passingValue && px >= minmax.maxX : px >= minmax.maxX) {
39471
+ if (px >= minmax.maxX) {
39478
39472
  minmax.maxX = px === null ? 0 : px;
39479
39473
 
39480
39474
  if (isHorizontal && px !== null) {
@@ -39483,7 +39477,7 @@ var modules = {
39483
39477
  }
39484
39478
  }
39485
39479
 
39486
- if (usePassingValue ? po !== passingValue && py >= minmax.maxY : py >= minmax.maxY) {
39480
+ if (py >= minmax.maxY) {
39487
39481
  minmax.maxY = py === null ? 0 : py;
39488
39482
 
39489
39483
  if (!isHorizontal && py !== null) {
@@ -40237,25 +40231,14 @@ var modules = {
40237
40231
  }
40238
40232
  }
40239
40233
 
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) {
40234
+ if (smm.maxX >= minmax.x[axisX].max) {
40247
40235
  minmax.x[axisX].max = smm.maxX;
40248
40236
  minmax.x[axisX].maxSID = key;
40249
40237
  }
40250
40238
 
40251
- var maxYisNegative = minmax.y[axisY].max < 0;
40252
-
40253
- if (isExistGrp && maxYisNegative) {
40239
+ if (smm.maxY >= minmax.y[axisY].max) {
40254
40240
  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) {
40257
- minmax.y[axisY].max = smm.maxY;
40258
- minmax.y[axisY].maxSID = key;
40241
+ minmax.y[axisX].maxSID = key;
40259
40242
  }
40260
40243
  }
40261
40244
 
@@ -41716,6 +41699,8 @@ var TIME_INTERVALS = {
41716
41699
 
41717
41700
 
41718
41701
 
41702
+
41703
+
41719
41704
 
41720
41705
  var element_line_Line = /*#__PURE__*/function () {
41721
41706
  function Line(sId, opt, sIdx) {
@@ -41850,6 +41835,7 @@ var element_line_Line = /*#__PURE__*/function () {
41850
41835
  ctx.setLineDash(this.segments);
41851
41836
  }
41852
41837
 
41838
+ var endPoint = chartRect.y2 - labelOffset.bottom;
41853
41839
  var isLinearInterpolation = this.useLinearInterpolation();
41854
41840
  var barAreaByCombo = 0;
41855
41841
  var minmaxX = axesSteps.x[this.xAxisIndex];
@@ -41872,12 +41858,8 @@ var element_line_Line = /*#__PURE__*/function () {
41872
41858
 
41873
41859
  var getYPos = function getYPos(val) {
41874
41860
  return helpers_canvas.calculateY(val, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
41875
- };
41861
+ }; // draw line
41876
41862
 
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
41881
41863
 
41882
41864
  var prevValid;
41883
41865
  this.data.forEach(function (curr) {
@@ -41937,10 +41919,9 @@ var element_line_Line = /*#__PURE__*/function () {
41937
41919
  }
41938
41920
  });
41939
41921
  var gradient = ctx.createLinearGradient(0, chartRect.y2, 0, maxValueYPos);
41940
- var mainGradientColor = extent.opacity < 1 ? fillColor : mainColor;
41941
- gradient.addColorStop(0, includeNegativeValue ? mainGradientColor : fillColor);
41922
+ gradient.addColorStop(0, fillColor);
41942
41923
  gradient.addColorStop(0.5, fillColor);
41943
- gradient.addColorStop(1, mainGradientColor);
41924
+ gradient.addColorStop(1, extent.opacity < 1 ? fillColor : mainColor);
41944
41925
  ctx.fillStyle = gradient;
41945
41926
  } else {
41946
41927
  ctx.fillStyle = fillColor;
@@ -42008,7 +41989,7 @@ var element_line_Line = /*#__PURE__*/function () {
42008
41989
 
42009
41990
  var nextData = _this2.data[jx];
42010
41991
  var xp = getXPos(nextData.x);
42011
- var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : getYPos(0);
41992
+ var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : endPoint;
42012
41993
  ctx.lineTo(xp, bp);
42013
41994
  }
42014
41995
 
@@ -42104,78 +42085,166 @@ var element_line_Line = /*#__PURE__*/function () {
42104
42085
  var gdata = this.data.filter(function (data) {
42105
42086
  return !helpers_util.isNullOrUndefined(data.x);
42106
42087
  });
42107
- var SPARE_XP = 0.5;
42108
42088
  var isLinearInterpolation = this.useLinearInterpolation();
42109
42089
 
42110
42090
  if (gdata !== null && gdata !== void 0 && gdata.length) {
42111
42091
  if (typeof dataIndex === 'number' && this.show) {
42112
42092
  item.data = gdata[dataIndex];
42113
42093
  item.index = dataIndex;
42094
+
42095
+ if (item.data) {
42096
+ var point = gdata[dataIndex];
42097
+ var yDist = Math.abs(yp - point.yp);
42098
+ var directHitThreshold = 15; // 직접 히트 임계값
42099
+
42100
+ if (yDist <= directHitThreshold) {
42101
+ item.hit = true;
42102
+ }
42103
+ }
42114
42104
  } else if (typeof this.beforeFindItemIndex === 'number' && this.show && useSelectLabelOrItem) {
42115
42105
  item.data = gdata[this.beforeFindItemIndex];
42116
42106
  item.index = this.beforeFindItemIndex;
42117
42107
  } else {
42118
- var _gdata$;
42119
-
42120
- var s = 0;
42121
- var e = gdata.length - 1;
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);
42124
-
42125
- while (s <= e) {
42126
- var m = Math.floor((s + e) / 2);
42127
- var x = gdata[m].xp;
42128
- var y = gdata[m].yp;
42129
-
42130
- if (x - xpInterval <= xp && xp <= x + xpInterval) {
42131
- var _gdata$m, _gdata$xp, _gdata, _gdata2, _gdata3;
42132
-
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);
42134
-
42135
- if ((_gdata2 = gdata[m - 1]) !== null && _gdata2 !== void 0 && _gdata2.xp && (_gdata3 = gdata[m + 1]) !== null && _gdata3 !== void 0 && _gdata3.xp && curXpInterval > 0) {
42136
- var leftXp = Math.abs(xp - gdata[m - 1].xp);
42137
- var midXp = Math.abs(xp - gdata[m].xp);
42138
- var rightXp = Math.abs(gdata[m + 1].xp - xp);
42139
-
42140
- if (Math.abs(this.beforeMouseXp - xp) >= curXpInterval - SPARE_XP && (this.beforeFindItemIndex === m || midXp === rightXp || midXp === leftXp)) {
42141
- if (this.beforeMouseXp - xp > 0) {
42142
- item.data = gdata[this.beforeFindItemIndex - 1];
42143
- item.index = this.beforeFindItemIndex - 1;
42144
- } else if (this.beforeMouseXp - xp < 0) {
42145
- item.data = gdata[this.beforeFindItemIndex + 1];
42146
- item.index = this.beforeFindItemIndex + 1;
42147
- } else if (this.beforeMouseYp !== yp) {
42148
- item.data = gdata[this.beforeFindItemIndex];
42149
- item.index = this.beforeFindItemIndex;
42150
- }
42151
- } else {
42152
- var closeXp = Math.min(leftXp, midXp, rightXp);
42153
-
42154
- if (closeXp === leftXp) {
42155
- item.data = gdata[m - 1];
42156
- item.index = m - 1;
42157
- } else if (closeXp === rightXp) {
42158
- item.data = gdata[m + 1];
42159
- item.index = m + 1;
42160
- } else {
42161
- item.data = gdata[m];
42162
- item.index = m;
42163
- }
42108
+ // Axis 트리거 방식: X축 위치에서 가장 가까운 데이터 포인트 찾기
42109
+ var closestXDistance = Infinity;
42110
+ var closestIndex = -1; // null이 아닌 유효한 데이터만 필터링
42111
+
42112
+ var validData = [];
42113
+ gdata.forEach(function (point, idx) {
42114
+ if (point.xp !== null && point.yp !== null && point.o !== null) {
42115
+ validData.push(_objectSpread2(_objectSpread2({}, point), {}, {
42116
+ originalIndex: idx
42117
+ }));
42118
+ }
42119
+ });
42120
+
42121
+ if (validData.length === 0) {
42122
+ return item;
42123
+ } // 이진 탐색으로 가장 가까운 포인트 찾기
42124
+
42125
+
42126
+ var left = 0;
42127
+ var right = validData.length - 1;
42128
+
42129
+ while (left <= right) {
42130
+ var mid = Math.floor((left + right) / 2);
42131
+ var _point = validData[mid];
42132
+ var xDistance = Math.abs(xp - _point.xp);
42133
+
42134
+ if (xDistance < closestXDistance) {
42135
+ closestXDistance = xDistance;
42136
+ closestIndex = _point.originalIndex;
42137
+ }
42138
+
42139
+ if (_point.xp < xp) {
42140
+ left = mid + 1; // 다음 포인트도 확인
42141
+
42142
+ if (left < validData.length) {
42143
+ var nextDistance = Math.abs(xp - validData[left].xp);
42144
+
42145
+ if (nextDistance < closestXDistance) {
42146
+ closestXDistance = nextDistance;
42147
+ closestIndex = validData[left].originalIndex;
42164
42148
  }
42165
- } else {
42166
- item.data = gdata[m];
42167
- item.index = m;
42168
42149
  }
42150
+ } else if (_point.xp > xp) {
42151
+ right = mid - 1; // 이전 포인트도 확인
42169
42152
 
42170
- if (y - 6 <= yp && yp <= y + 6) {
42171
- item.hit = true;
42172
- }
42153
+ if (right >= 0) {
42154
+ var prevDistance = Math.abs(xp - validData[right].xp);
42173
42155
 
42156
+ if (prevDistance < closestXDistance) {
42157
+ closestXDistance = prevDistance;
42158
+ closestIndex = validData[right].originalIndex;
42159
+ }
42160
+ }
42161
+ } else {
42162
+ // 정확히 일치하는 경우
42174
42163
  break;
42175
- } else if (x + xpInterval > xp) {
42176
- e = m - 1;
42164
+ }
42165
+ } // 이진 탐색 후 주변 포인트 추가 확인 (정확도 향상)
42166
+
42167
+
42168
+ var foundIdx = validData.findIndex(function (p) {
42169
+ return p.originalIndex === closestIndex;
42170
+ });
42171
+
42172
+ if (foundIdx !== -1) {
42173
+ // 앞뒤 2개씩 추가 확인
42174
+ for (var i = Math.max(0, foundIdx - 2); i <= Math.min(validData.length - 1, foundIdx + 2); i++) {
42175
+ var _point2 = validData[i];
42176
+
42177
+ var _xDistance = Math.abs(xp - _point2.xp);
42178
+
42179
+ if (_xDistance < closestXDistance) {
42180
+ closestXDistance = _xDistance;
42181
+ closestIndex = _point2.originalIndex;
42182
+ }
42183
+ }
42184
+ } // 가장 가까운 포인트 설정
42185
+
42186
+
42187
+ if (closestIndex !== -1) {
42188
+ // 데이터 간격 계산 - 모든 데이터(null 포함)의 평균 간격 사용
42189
+ var avgInterval = 50;
42190
+
42191
+ if (gdata.length > 1) {
42192
+ var intervals = [];
42193
+
42194
+ for (var _i = 1; _i < gdata.length; _i++) {
42195
+ if (gdata[_i].xp !== null && gdata[_i - 1].xp !== null) {
42196
+ intervals.push(Math.abs(gdata[_i].xp - gdata[_i - 1].xp));
42197
+ }
42198
+ }
42199
+
42200
+ if (intervals.length > 0) {
42201
+ avgInterval = intervals.reduce(function (a, b) {
42202
+ return a + b;
42203
+ }, 0) / intervals.length;
42204
+ }
42205
+ } // 두 가지 임계값 설정
42206
+
42207
+
42208
+ var strictThreshold = avgInterval * 0.3; // 엄격한 임계값: 데이터 간격의 30%
42209
+
42210
+ var relaxedThreshold = avgInterval; // 느슨한 임계값: 데이터 간격 전체
42211
+ // 1. 먼저 엄격한 임계값으로 정확한 매치 확인
42212
+
42213
+ if (closestXDistance <= strictThreshold) {
42214
+ // 정확히 일치하거나 매우 가까운 데이터가 있음
42215
+ item.data = gdata[closestIndex];
42216
+ item.index = closestIndex;
42177
42217
  } else {
42178
- s = m + 1;
42218
+ // 2. 정확한 매치가 없을 때, 현재 X 위치 근처에 다른 유효 데이터가 있는지 확인
42219
+ var hasNearbyValidData = false;
42220
+
42221
+ for (var _i2 = 0; _i2 < validData.length; _i2++) {
42222
+ var xDist = Math.abs(xp - validData[_i2].xp);
42223
+
42224
+ if (xDist <= strictThreshold) {
42225
+ hasNearbyValidData = true;
42226
+ break;
42227
+ }
42228
+ } // 3. 근처에 다른 유효 데이터가 없을 때만 느슨한 임계값 적용
42229
+
42230
+
42231
+ if (!hasNearbyValidData && closestXDistance <= relaxedThreshold) {
42232
+ item.data = gdata[closestIndex];
42233
+ item.index = closestIndex;
42234
+ }
42235
+ } // Y축 거리를 확인하여 직접 히트 판정
42236
+
42237
+
42238
+ if (item.data) {
42239
+ var _point3 = gdata[closestIndex];
42240
+
42241
+ var _yDist = Math.abs(yp - _point3.yp);
42242
+
42243
+ var _directHitThreshold = 15; // 직접 히트 임계값
42244
+
42245
+ if (_yDist <= _directHitThreshold) {
42246
+ item.hit = true;
42247
+ }
42179
42248
  }
42180
42249
  }
42181
42250
  }
@@ -42206,6 +42275,8 @@ var element_line_Line = /*#__PURE__*/function () {
42206
42275
  }, {
42207
42276
  key: "findApproximateData",
42208
42277
  value: function findApproximateData(offset) {
42278
+ var _gdata$, _gdata$2;
42279
+
42209
42280
  var xp = offset[0];
42210
42281
  var yp = offset[1];
42211
42282
  var item = {
@@ -42216,41 +42287,87 @@ var element_line_Line = /*#__PURE__*/function () {
42216
42287
  var gdata = this.data.filter(function (data) {
42217
42288
  return !helpers_util.isNullOrUndefined(data.x);
42218
42289
  });
42290
+
42291
+ if (!gdata.length) {
42292
+ return item;
42293
+ } // 동적 감지 범위 계산
42294
+
42295
+
42296
+ var gap = gdata.length > 1 ? Math.abs(((_gdata$ = gdata[1]) === null || _gdata$ === void 0 ? void 0 : _gdata$.xp) - ((_gdata$2 = gdata[0]) === null || _gdata$2 === void 0 ? void 0 : _gdata$2.xp)) : 50;
42297
+ var xpInterval = Math.max(gap * 0.4, 10); // 데이터 간격의 40% 또는 최소 10px
42298
+
42219
42299
  var s = 0;
42220
42300
  var e = gdata.length - 1;
42301
+ var closestIndex = -1;
42302
+ var closestDistance = Infinity; // 이진 탐색으로 근처 데이터 찾기
42221
42303
 
42222
42304
  while (s <= e) {
42223
42305
  var m = Math.floor((s + e) / 2);
42224
- var x = gdata[m].xp;
42225
- var y = gdata[m].yp;
42306
+ var x = gdata[m].xp; // X 좌표가 감지 범위 내에 있는 경우
42226
42307
 
42227
- if (x - 2 <= xp && xp <= x + 2) {
42228
- item.data = gdata[m];
42229
- item.index = m;
42308
+ if (x - xpInterval <= xp && xp <= x + xpInterval) {
42309
+ // 중간점 주변 데이터들과 거리 비교
42310
+ var checkStart = Math.max(0, m - 2);
42311
+ var checkEnd = Math.min(gdata.length - 1, m + 2);
42230
42312
 
42231
- if (y - 2 <= yp && yp <= y + 2) {
42232
- item.hit = true;
42313
+ for (var i = checkStart; i <= checkEnd; i++) {
42314
+ if (gdata[i].xp !== null && gdata[i].yp !== null) {
42315
+ var distance = Math.sqrt(Math.pow(xp - gdata[i].xp, 2) + Math.pow(yp - gdata[i].yp, 2));
42316
+
42317
+ if (distance < closestDistance) {
42318
+ closestDistance = distance;
42319
+ closestIndex = i;
42320
+ }
42321
+ }
42322
+ }
42323
+
42324
+ if (closestIndex !== -1) {
42325
+ item.data = gdata[closestIndex];
42326
+ item.index = closestIndex; // 매우 가까운 경우 hit으로 표시
42327
+
42328
+ if (closestDistance < 5) {
42329
+ item.hit = true;
42330
+ }
42233
42331
  }
42234
42332
 
42235
42333
  return item;
42236
- } else if (x + 2 < xp) {
42334
+ } else if (x + xpInterval < xp) {
42335
+ // 마우스가 오른쪽에 있는 경우
42237
42336
  if (m < e && xp < gdata[m + 1].xp) {
42238
42337
  var curr = Math.abs(gdata[m].xp - xp);
42239
42338
  var next = Math.abs(gdata[m + 1].xp - xp);
42240
42339
  item.data = curr > next ? gdata[m + 1] : gdata[m];
42241
- item.index = curr > next ? m + 1 : m;
42340
+ item.index = curr > next ? m + 1 : m; // Y 거리도 확인하여 hit 판정
42341
+
42342
+ var selectedPoint = item.data;
42343
+ var yDist = Math.abs(yp - selectedPoint.yp);
42344
+
42345
+ if (yDist < 10) {
42346
+ item.hit = true;
42347
+ }
42348
+
42242
42349
  return item;
42243
42350
  }
42244
42351
 
42245
42352
  s = m + 1;
42246
42353
  } else {
42354
+ // 마우스가 왼쪽에 있는 경우
42247
42355
  if (m > 0 && xp > gdata[m - 1].xp) {
42248
42356
  var prev = Math.abs(gdata[m - 1].xp - xp);
42249
42357
 
42250
42358
  var _curr = Math.abs(gdata[m].xp - xp);
42251
42359
 
42252
42360
  item.data = prev > _curr ? gdata[m] : gdata[m - 1];
42253
- item.index = prev > _curr ? m : m - 1;
42361
+ item.index = prev > _curr ? m : m - 1; // Y 거리도 확인하여 hit 판정
42362
+
42363
+ var _selectedPoint = item.data;
42364
+
42365
+ var _yDist2 = Math.abs(yp - _selectedPoint.yp);
42366
+
42367
+ if (_yDist2 < 10) {
42368
+ item.hit = true;
42369
+ }
42370
+
42254
42371
  return item;
42255
42372
  }
42256
42373
 
@@ -42701,6 +42818,7 @@ var element_scatter_Scatter = /*#__PURE__*/function () {
42701
42818
 
42702
42819
 
42703
42820
 
42821
+
42704
42822
  var element_bar_Bar = /*#__PURE__*/function () {
42705
42823
  function Bar(sId, opt, sIdx, isHorizontal) {
42706
42824
  var _this = this;
@@ -42763,18 +42881,11 @@ var element_bar_Bar = /*#__PURE__*/function () {
42763
42881
  var minmaxX = axesSteps.x[this.xAxisIndex];
42764
42882
  var minmaxY = axesSteps.y[this.yAxisIndex];
42765
42883
  var totalCount = this.data.length;
42766
- var minIndex;
42767
- var maxIndex;
42768
42884
 
42769
- if (isHorizontal) {
42770
- var _ref = [minmaxY.minIndex, minmaxY.maxIndex];
42771
- minIndex = _ref[0];
42772
- maxIndex = _ref[1];
42773
- } else {
42774
- var _ref2 = [minmaxX.minIndex, minmaxX.maxIndex];
42775
- minIndex = _ref2[0];
42776
- maxIndex = _ref2[1];
42777
- } // minIndex, maxIndex가 유효하면 실제 그릴 데이터 개수로 보정
42885
+ var _ref = isHorizontal ? [minmaxY.minIndex, minmaxY.maxIndex] : [minmaxX.minIndex, minmaxX.maxIndex],
42886
+ _ref2 = _slicedToArray(_ref, 2),
42887
+ minIndex = _ref2[0],
42888
+ maxIndex = _ref2[1]; // minIndex, maxIndex가 유효하면 실제 그릴 데이터 개수로 보정
42778
42889
 
42779
42890
 
42780
42891
  if (truthyNumber(minIndex) && truthyNumber(maxIndex)) {
@@ -42783,12 +42894,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
42783
42894
 
42784
42895
  var xArea = chartRect.chartWidth - (labelOffset.left + labelOffset.right);
42785
42896
  var yArea = chartRect.chartHeight - (labelOffset.top + labelOffset.bottom);
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;
42897
+ var xsp = chartRect.x1 + labelOffset.left;
42898
+ var ysp = chartRect.y2 - labelOffset.bottom;
42792
42899
  var dArea = isHorizontal ? yArea : xArea;
42793
42900
  var cArea = dArea / (totalCount || 1);
42794
42901
  var cPad;
@@ -42805,20 +42912,7 @@ var element_bar_Bar = /*#__PURE__*/function () {
42805
42912
  var h;
42806
42913
  bArea = cArea > cPad * 2 ? cArea - cPad * 2 : cArea;
42807
42914
  bArea = this.isExistGrp ? bArea : bArea / showSeriesCount;
42808
-
42809
- var getSize = function getSize() {
42810
- if (typeof thickness === 'string' && /[0-9]+px/.test(thickness)) {
42811
- return Math.min(bArea, Number(thickness.replace('px', '')));
42812
- }
42813
-
42814
- if (typeof thickness === 'number' && thickness <= 1 && thickness >= 0) {
42815
- return Math.ceil(bArea * thickness);
42816
- }
42817
-
42818
- return bArea;
42819
- };
42820
-
42821
- var size = getSize();
42915
+ var size = this.calculateBarSize(thickness, bArea);
42822
42916
  w = isHorizontal ? null : size;
42823
42917
  h = isHorizontal ? size : null;
42824
42918
  var bPad = isHorizontal ? (bArea - h) / 2 : (bArea - w) / 2;
@@ -42846,14 +42940,7 @@ var element_bar_Bar = /*#__PURE__*/function () {
42846
42940
  var _param$selectLabel, _param$selectItem, _param$selectLabel$se, _param$selectLabel2, _param$selectLabel2$s, _param$selectItem$sel, _param$selectItem2;
42847
42941
 
42848
42942
  // 스크롤 offset(minIndex)만큼 보정해서 그리기
42849
- var categoryPoint = void 0;
42850
-
42851
- if (isHorizontal) {
42852
- categoryPoint = ysp - cArea * screenIndex - cPad;
42853
- } else {
42854
- categoryPoint = xsp + cArea * screenIndex + cPad;
42855
- } // 기본 위치 설정
42856
-
42943
+ var categoryPoint = isHorizontal ? ysp - cArea * screenIndex - cPad : xsp + cArea * screenIndex + cPad;
42857
42944
 
42858
42945
  if (isHorizontal) {
42859
42946
  x = xsp;
@@ -42861,30 +42948,22 @@ var element_bar_Bar = /*#__PURE__*/function () {
42861
42948
  } else {
42862
42949
  x = Math.round(categoryPoint + (bArea * barSeriesX - (w + bPad)));
42863
42950
  y = ysp;
42864
- } // 너비 / 높이 계산, 스택의 경우 위치 값 재계산
42865
-
42951
+ }
42866
42952
 
42867
42953
  if (isHorizontal) {
42868
- var barValue = item.b ? item.o : item.x;
42869
- w = helpers_canvas.calculateX(barValue, minmaxX.graphMin, minmaxX.graphMax, xArea, -xZeroPosition);
42870
-
42871
42954
  if (item.b) {
42872
- x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp - xZeroPosition);
42955
+ w = helpers_canvas.calculateX(item.x - item.b, minmaxX.graphMin, minmaxX.graphMax, xArea);
42956
+ x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp);
42957
+ } else {
42958
+ w = helpers_canvas.calculateX(item.x, minmaxX.graphMin, minmaxX.graphMax, xArea);
42873
42959
  }
42874
-
42875
- var minimumBarWidth = barValue > 0 ? -1 : 1;
42876
- w = barValue && Math.abs(w) === 0 ? minimumBarWidth : w;
42960
+ } else if (item.b) {
42961
+ // vertical stack bar chart
42962
+ h = helpers_canvas.calculateY(item.y - item.b, minmaxY.graphMin, minmaxY.graphMax, yArea);
42963
+ y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
42877
42964
  } else {
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;
42965
+ // vertical bar chart
42966
+ h = helpers_canvas.calculateY(item.y, minmaxY.graphMin, minmaxY.graphMax, yArea);
42888
42967
  }
42889
42968
 
42890
42969
  var barColor = item.dataColor || this.color;
@@ -43039,13 +43118,32 @@ var element_bar_Bar = /*#__PURE__*/function () {
43039
43118
  * Find graph item
43040
43119
  * @param {array} offset mouse position
43041
43120
  * @param {boolean} isHorizontal determines if a horizontal option's value
43121
+ * @param {number} dataIndex selected label data index
43122
+ * @param {boolean} useIndicatorOnLabel
43042
43123
  *
43043
43124
  * @returns {object} graph item
43044
43125
  */
43045
43126
 
43046
43127
  }, {
43047
43128
  key: "findGraphData",
43048
- value: function findGraphData(offset, isHorizontal) {
43129
+ value: function findGraphData(offset, isHorizontal, dataIndex, useIndicatorOnLabel) {
43130
+ if (typeof dataIndex === 'number' && this.show && useIndicatorOnLabel) {
43131
+ var gdata = this.data;
43132
+ var item = {
43133
+ data: null,
43134
+ hit: false,
43135
+ color: this.color
43136
+ };
43137
+
43138
+ if (gdata[dataIndex]) {
43139
+ item.data = gdata[dataIndex];
43140
+ item.index = dataIndex;
43141
+ item.hit = this.isPointInBar(offset, gdata[dataIndex]);
43142
+ }
43143
+
43144
+ return item;
43145
+ }
43146
+
43049
43147
  return isHorizontal ? this.findGraphRangeCount(offset) : this.findGraphRange(offset);
43050
43148
  }
43051
43149
  /**
@@ -43055,13 +43153,23 @@ var element_bar_Bar = /*#__PURE__*/function () {
43055
43153
  * @returns {object} graph item
43056
43154
  */
43057
43155
 
43156
+ /**
43157
+ * Binary search for finding graph item
43158
+ * @private
43159
+ * @param {array} offset - mouse position
43160
+ * @param {boolean} isHorizontal - search orientation
43161
+ * @returns {object} graph item
43162
+ */
43163
+
43058
43164
  }, {
43059
- key: "findGraphRange",
43060
- value: function findGraphRange(offset) {
43165
+ key: "binarySearchBar",
43166
+ value: function binarySearchBar(offset, isHorizontal) {
43061
43167
  var _this$filteredCount;
43062
43168
 
43063
- var xp = offset[0];
43064
- var yp = offset[1];
43169
+ var _offset = _slicedToArray(offset, 2),
43170
+ xp = _offset[0],
43171
+ yp = _offset[1];
43172
+
43065
43173
  var item = {
43066
43174
  data: null,
43067
43175
  hit: false,
@@ -43074,21 +43182,25 @@ var element_bar_Bar = /*#__PURE__*/function () {
43074
43182
 
43075
43183
  while (s <= e) {
43076
43184
  var m = Math.floor((s + e) / 2);
43077
- var sx = gdata[m].xp;
43078
- var sy = gdata[m].yp;
43079
- var ex = sx + gdata[m].w;
43080
- var ey = sy + gdata[m].h;
43081
-
43082
- if (sx <= xp && xp <= ex) {
43083
- item.data = gdata[m];
43084
- item.index = gdata[m].index; // 원본 데이터 인덱스 사용
43185
+ var barData = gdata[m];
43186
+ var sx = barData.xp,
43187
+ sy = barData.yp,
43188
+ w = barData.w,
43189
+ h = barData.h;
43190
+ var ex = sx + w;
43191
+ var ey = sy + h;
43192
+ var inRange = isHorizontal ? ey <= yp && yp <= sy : sx <= xp && xp <= ex;
43193
+
43194
+ if (inRange) {
43195
+ item.data = barData;
43196
+ item.index = barData.index;
43197
+ item.hit = this.isPointInBar(offset, barData);
43198
+ return item;
43199
+ }
43085
43200
 
43086
- if (ey <= yp && yp <= sy) {
43087
- item.hit = true;
43088
- }
43201
+ var shouldGoRight = isHorizontal ? !(ey < yp) : sx + 4 < xp;
43089
43202
 
43090
- return item;
43091
- } else if (sx + 4 < xp) {
43203
+ if (shouldGoRight) {
43092
43204
  s = m + 1;
43093
43205
  } else {
43094
43206
  e = m - 1;
@@ -43097,6 +43209,11 @@ var element_bar_Bar = /*#__PURE__*/function () {
43097
43209
 
43098
43210
  return item;
43099
43211
  }
43212
+ }, {
43213
+ key: "findGraphRange",
43214
+ value: function findGraphRange(offset) {
43215
+ return this.binarySearchBar(offset, false);
43216
+ }
43100
43217
  /**
43101
43218
  * Find graph item (horizontal)
43102
43219
  * @param {array} offset mouse position
@@ -43107,44 +43224,7 @@ var element_bar_Bar = /*#__PURE__*/function () {
43107
43224
  }, {
43108
43225
  key: "findGraphRangeCount",
43109
43226
  value: function findGraphRangeCount(offset) {
43110
- var _this$filteredCount2;
43111
-
43112
- var xp = offset[0];
43113
- var yp = offset[1];
43114
- var item = {
43115
- data: null,
43116
- hit: false,
43117
- color: this.color
43118
- };
43119
- var gdata = this.data;
43120
- var totalCount = (_this$filteredCount2 = this.filteredCount) !== null && _this$filteredCount2 !== void 0 ? _this$filteredCount2 : gdata.length;
43121
- var s = 0;
43122
- var e = totalCount - 1;
43123
-
43124
- while (s <= e) {
43125
- var m = Math.floor((s + e) / 2);
43126
- var sx = gdata[m].xp;
43127
- var sy = gdata[m].yp;
43128
- var ex = sx + gdata[m].w;
43129
- var ey = sy + gdata[m].h;
43130
-
43131
- if (ey <= yp && yp <= sy) {
43132
- item.data = gdata[m];
43133
- item.index = gdata[m].index; // 원본 데이터 인덱스 사용
43134
-
43135
- if (sx <= xp && xp <= ex) {
43136
- item.hit = true;
43137
- }
43138
-
43139
- return item;
43140
- } else if (ey < yp) {
43141
- e = m - 1;
43142
- } else {
43143
- s = m + 1;
43144
- }
43145
- }
43146
-
43147
- return item;
43227
+ return this.binarySearchBar(offset, true);
43148
43228
  }
43149
43229
  /**
43150
43230
  * Draw value label if series 'use' of showValue option is true
@@ -43173,10 +43253,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
43173
43253
  align = _this$showValue.align,
43174
43254
  formatter = _this$showValue.formatter,
43175
43255
  decimalPoint = _this$showValue.decimalPoint;
43176
- var barX = positions.x,
43177
- barY = positions.y,
43178
- barWidth = positions.w,
43179
- barHeight = positions.h;
43256
+ var x = positions.x,
43257
+ y = positions.y,
43258
+ w = positions.w,
43259
+ h = positions.h;
43180
43260
  var ctx = context;
43181
43261
  ctx.save();
43182
43262
  ctx.beginPath();
@@ -43211,27 +43291,25 @@ var element_bar_Bar = /*#__PURE__*/function () {
43211
43291
  formattedTxt = (_Util$labelSignFormat = helpers_util.labelSignFormat(value, decimalPoint)) !== null && _Util$labelSignFormat !== void 0 ? _Util$labelSignFormat : '';
43212
43292
  }
43213
43293
 
43214
- var isNegativeValue = value < 0;
43215
43294
  var textWidth = Math.round(ctx.measureText(formattedTxt).width);
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;
43295
+ var textHeight = fontSize + 4;
43296
+ var minXPos = x + 10;
43297
+ var minYPos = y - 10;
43298
+ var widthFreeSpaceToDraw = w - 10;
43299
+ var heightFreeSpaceToDraw = Math.abs(h + 10);
43300
+ var centerX = x + w / 2 <= minXPos ? minXPos : x + w / 2;
43301
+ var centerY = y + h / 2 >= minYPos ? minYPos : y + h / 2;
43302
+ var centerYHorizontal = isHighlight ? y + h / 2 : y - h / 2;
43225
43303
 
43226
43304
  switch (align) {
43227
43305
  case 'start':
43228
43306
  {
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);
43307
+ if (isHorizontal) {
43308
+ if (textWidth < widthFreeSpaceToDraw) {
43309
+ ctx.fillText(formattedTxt, minXPos, centerYHorizontal);
43310
+ }
43311
+ } else if (textHeight < heightFreeSpaceToDraw) {
43312
+ ctx.fillText(formattedTxt, centerX, minYPos);
43235
43313
  }
43236
43314
 
43237
43315
  break;
@@ -43239,10 +43317,12 @@ var element_bar_Bar = /*#__PURE__*/function () {
43239
43317
 
43240
43318
  case 'center':
43241
43319
  {
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);
43320
+ if (isHorizontal) {
43321
+ if (textWidth < widthFreeSpaceToDraw) {
43322
+ ctx.fillText(formattedTxt, centerX, centerYHorizontal);
43323
+ }
43324
+ } else if (textHeight < heightFreeSpaceToDraw) {
43325
+ ctx.fillText(formattedTxt, centerX, centerY);
43246
43326
  }
43247
43327
 
43248
43328
  break;
@@ -43256,26 +43336,9 @@ var element_bar_Bar = /*#__PURE__*/function () {
43256
43336
  }
43257
43337
 
43258
43338
  if (isHorizontal) {
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
- }
43339
+ ctx.fillText(formattedTxt, minXPos + w, centerYHorizontal);
43275
43340
  } else {
43276
- var _yPos = isNegativeValue ? barY + barHeight + GAP : barY + barHeight - GAP;
43277
-
43278
- ctx.fillText(formattedTxt, centerXOnBar, _yPos);
43341
+ ctx.fillText(formattedTxt, centerX, y + h - textHeight / 2);
43279
43342
  }
43280
43343
 
43281
43344
  break;
@@ -43284,22 +43347,14 @@ var element_bar_Bar = /*#__PURE__*/function () {
43284
43347
  default:
43285
43348
  case 'end':
43286
43349
  {
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);
43350
+ if (isHorizontal) {
43351
+ if (textWidth < widthFreeSpaceToDraw) {
43352
+ var xPos = x + w - textWidth * 2;
43353
+ ctx.fillText(formattedTxt, xPos <= minXPos ? minXPos : xPos, centerYHorizontal);
43302
43354
  }
43355
+ } else if (textHeight < heightFreeSpaceToDraw) {
43356
+ var yPos = y + h + textHeight;
43357
+ ctx.fillText(formattedTxt, centerX, yPos >= minYPos ? minYPos : yPos);
43303
43358
  }
43304
43359
 
43305
43360
  break;
@@ -43308,14 +43363,36 @@ var element_bar_Bar = /*#__PURE__*/function () {
43308
43363
 
43309
43364
  ctx.restore();
43310
43365
  }
43366
+ /**
43367
+ * Calculate bar size based on thickness
43368
+ * @private
43369
+ * @param {string|number} thickness - thickness value
43370
+ * @param {number} bArea - available bar area
43371
+ * @returns {number} calculated size
43372
+ */
43373
+
43374
+ }, {
43375
+ key: "calculateBarSize",
43376
+ value: function calculateBarSize(thickness, bArea) {
43377
+ if (typeof thickness === 'string' && /[0-9]+px/.test(thickness)) {
43378
+ return Math.min(bArea, Number(thickness.replace('px', '')));
43379
+ }
43380
+
43381
+ if (typeof thickness === 'number' && thickness <= 1 && thickness >= 0) {
43382
+ return Math.ceil(bArea * thickness);
43383
+ }
43384
+
43385
+ return bArea;
43386
+ }
43311
43387
  }, {
43312
43388
  key: "drawBar",
43313
43389
  value: function drawBar(_ref6) {
43314
43390
  var ctx = _ref6.ctx,
43315
43391
  positions = _ref6.positions;
43316
- var isHorizontal = this.isHorizontal;
43392
+ var isHorizontal = this.isHorizontal,
43393
+ borderRadius = this.borderRadius;
43317
43394
  var isStackBar = ('stackIndex' in this);
43318
- var isBorderRadius = this.borderRadius && this.borderRadius > 0;
43395
+ var isBorderRadius = borderRadius && borderRadius > 0;
43319
43396
  var x = positions.x,
43320
43397
  y = positions.y,
43321
43398
  w = positions.w;
@@ -43339,67 +43416,68 @@ var element_bar_Bar = /*#__PURE__*/function () {
43339
43416
 
43340
43417
  ctx.restore();
43341
43418
  }
43419
+ /**
43420
+ * Check if point is within bar boundaries
43421
+ * @param {array} offset - [x, y] mouse position
43422
+ * @param {object} barData - bar data object with xp, yp, w, h properties
43423
+ * @returns {boolean} true if point is within bar
43424
+ */
43425
+
43426
+ }, {
43427
+ key: "isPointInBar",
43428
+ value: function isPointInBar(offset, barData) {
43429
+ var _offset2 = _slicedToArray(offset, 2),
43430
+ xp = _offset2[0],
43431
+ yp = _offset2[1];
43432
+
43433
+ var sx = barData.xp,
43434
+ sy = barData.yp,
43435
+ w = barData.w,
43436
+ h = barData.h;
43437
+ var ex = sx + w;
43438
+ var ey = sy + h;
43439
+ return sx <= xp && xp <= ex && ey <= yp && yp <= sy;
43440
+ }
43342
43441
  }, {
43343
43442
  key: "drawRoundedRect",
43344
43443
  value: function drawRoundedRect(ctx, positions) {
43345
- var chartRect = this.chartRect;
43346
- var labelOffset = this.labelOffset;
43347
- var isHorizontal = this.isHorizontal;
43444
+ var chartRect = this.chartRect,
43445
+ labelOffset = this.labelOffset,
43446
+ isHorizontal = this.isHorizontal,
43447
+ borderRadius = this.borderRadius;
43348
43448
  var x = positions.x,
43349
43449
  y = positions.y;
43350
43450
  var w = positions.w,
43351
43451
  h = positions.h;
43352
- var r = this.borderRadius;
43452
+ var r = borderRadius;
43353
43453
  var squarePath = new Path2D();
43354
43454
  squarePath.rect(chartRect.x1 + labelOffset.left, chartRect.y1, chartRect.chartWidth - labelOffset.right, chartRect.chartHeight - labelOffset.bottom);
43355
43455
  ctx.clip(squarePath);
43356
43456
  ctx.beginPath();
43357
43457
  ctx.moveTo(x, y);
43358
43458
 
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
-
43367
43459
  if (isHorizontal) {
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);
43460
+ if (h < r * 2) {
43461
+ r = h / 2;
43384
43462
  }
43463
+
43464
+ w -= r;
43465
+ ctx.lineTo(x + w, y);
43466
+ ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
43467
+ ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
43468
+ ctx.lineTo(x, y - h);
43469
+ ctx.lineTo(x, y);
43385
43470
  } else {
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);
43471
+ if (w < r * 2) {
43472
+ r = w / 2;
43402
43473
  }
43474
+
43475
+ h += r;
43476
+ ctx.lineTo(x + w, y);
43477
+ ctx.lineTo(x + w, y + h);
43478
+ ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
43479
+ ctx.arcTo(x, y + h - r, x, y + h, r);
43480
+ ctx.lineTo(x, y);
43403
43481
  }
43404
43482
 
43405
43483
  ctx.fill();
@@ -44723,7 +44801,7 @@ var element_heatmap_HeatMap = /*#__PURE__*/function () {
44723
44801
  key: "findSelectionRange",
44724
44802
  value: function findSelectionRange(rangeInfo) {
44725
44803
  var xsp = rangeInfo.xsp,
44726
- ycp = rangeInfo.ycp,
44804
+ ysp = rangeInfo.ysp,
44727
44805
  width = rangeInfo.width,
44728
44806
  height = rangeInfo.height,
44729
44807
  range = rangeInfo.range;
@@ -44751,7 +44829,6 @@ var element_heatmap_HeatMap = /*#__PURE__*/function () {
44751
44829
  var gapX = (x2 - x1) / labelXCount;
44752
44830
  var gapY = (y2 - y1) / labelYCount;
44753
44831
  var xep = xsp + width;
44754
- var ysp = ycp;
44755
44832
  var yep = ysp + height;
44756
44833
  var xIndex = {
44757
44834
  min: Math.floor((xsp - x1) / gapX),
@@ -44759,8 +44836,8 @@ var element_heatmap_HeatMap = /*#__PURE__*/function () {
44759
44836
  };
44760
44837
  var lastIndexY = labelYCount - 1;
44761
44838
  var yIndex = {
44762
- min: lastIndexY - Math.floor((yep - y1 - gapY) / gapY),
44763
- max: lastIndexY - Math.floor((ysp - y1) / gapY)
44839
+ min: lastIndexY - Math.round((yep - y1 - gapY) / gapY),
44840
+ max: lastIndexY - Math.round((ysp - y1) / gapY)
44764
44841
  };
44765
44842
  var filteredLabelX = this.getFilteredLabel(labelX, labelXCount, xMin, xMax);
44766
44843
  var filteredLabelY = this.getFilteredLabel(labelY, labelYCount, yMin, yMax);
@@ -45154,7 +45231,6 @@ var scale_Scale = /*#__PURE__*/function () {
45154
45231
  }
45155
45232
  /**
45156
45233
  * With range information, calculate how many labels in axis
45157
- * linear type은 scale.linear.js에서 처리
45158
45234
  * @param {object} range min/max information
45159
45235
  *
45160
45236
  * @returns {object} steps, interval, min/max graph value
@@ -45363,14 +45439,6 @@ var scale_Scale = /*#__PURE__*/function () {
45363
45439
 
45364
45440
  ctx.beginPath();
45365
45441
  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
-
45374
45442
  linePosition = labelCenter + aliasPixel;
45375
45443
  labelText = _this3.getLabelFormat(Math.min(axisMax, ticks[ix]), {
45376
45444
  prev: (_ticks = ticks[ix - 1]) !== null && _ticks !== void 0 ? _ticks : ''
@@ -45476,11 +45544,9 @@ var scale_Scale = /*#__PURE__*/function () {
45476
45544
  }
45477
45545
 
45478
45546
  var mergedPlotBandOpt = lodash_es_defaultsDeep({}, plotBand, PLOT_BAND_OPTION);
45479
- var userDefinedFrom = mergedPlotBandOpt.from,
45480
- userDefinedTo = mergedPlotBandOpt.to,
45547
+ var from = mergedPlotBandOpt.from,
45548
+ to = mergedPlotBandOpt.to,
45481
45549
  labelOpt = mergedPlotBandOpt.label;
45482
- var from = userDefinedFrom ? Math.max(userDefinedFrom, axisMin) : axisMin;
45483
- var to = userDefinedTo ? Math.min(userDefinedTo, axisMax) : axisMax;
45484
45550
 
45485
45551
  _this3.setPlotBandStyle(mergedPlotBandOpt);
45486
45552
 
@@ -45488,8 +45554,8 @@ var scale_Scale = /*#__PURE__*/function () {
45488
45554
  var toPos;
45489
45555
 
45490
45556
  if (_this3.type === 'x') {
45491
- fromPos = helpers_canvas.calculateX(from, axisMin, axisMax, xArea, minX);
45492
- toPos = helpers_canvas.calculateX(to, axisMin, axisMax, xArea, minX);
45557
+ fromPos = helpers_canvas.calculateX(from !== null && from !== void 0 ? from : minX, axisMin, axisMax, xArea, minX);
45558
+ toPos = helpers_canvas.calculateX(to !== null && to !== void 0 ? to : maxX, axisMin, axisMax, xArea, minX);
45493
45559
 
45494
45560
  if (fromPos === null || toPos === null) {
45495
45561
  return;
@@ -45497,8 +45563,8 @@ var scale_Scale = /*#__PURE__*/function () {
45497
45563
 
45498
45564
  _this3.drawXPlotBand(fromPos, toPos, minX, maxX, minY, maxY);
45499
45565
  } else {
45500
- fromPos = helpers_canvas.calculateY(from, axisMin, axisMax, yArea, maxY);
45501
- toPos = helpers_canvas.calculateY(to, axisMin, axisMax, yArea, maxY);
45566
+ fromPos = helpers_canvas.calculateY(from !== null && from !== void 0 ? from : axisMin, axisMin, axisMax, yArea, maxY);
45567
+ toPos = helpers_canvas.calculateY(to !== null && to !== void 0 ? to : axisMax, axisMin, axisMax, yArea, maxY);
45502
45568
 
45503
45569
  if (fromPos === null || toPos === null) {
45504
45570
  return;
@@ -46069,7 +46135,6 @@ var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
46069
46135
 
46070
46136
 
46071
46137
 
46072
-
46073
46138
  var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
46074
46139
  _inherits(LinearScale, _Scale);
46075
46140
 
@@ -46108,192 +46173,16 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
46108
46173
  * Calculate interval
46109
46174
  * @param {object} range range information
46110
46175
  *
46111
- * @returns {number} interval (한 칸에 표시할 값의 간격)
46176
+ * @returns {number} interval
46112
46177
  */
46113
46178
 
46114
46179
  }, {
46115
46180
  key: "getInterval",
46116
46181
  value: function getInterval(range) {
46117
- if (this.interval) return this.interval;
46118
46182
  var max = range.maxValue;
46119
46183
  var min = range.minValue;
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
- };
46184
+ var step = range.maxSteps;
46185
+ return this.interval ? this.interval : Math.ceil((max - min) / step);
46297
46186
  }
46298
46187
  }]);
46299
46188
 
@@ -47523,7 +47412,7 @@ var plugins_legend_modules = {
47523
47412
  var useLegendSeries = [];
47524
47413
 
47525
47414
  if (groups) {
47526
- useLegendSeries = groups.filter(function (sId) {
47415
+ useLegendSeries = groups.slice().reverse().filter(function (sId) {
47527
47416
  return _this3.seriesList[sId].showLegend;
47528
47417
  }).map(function (sId) {
47529
47418
  return [sId, _this3.seriesList[sId]];
@@ -47574,8 +47463,9 @@ var plugins_legend_modules = {
47574
47463
  },
47575
47464
 
47576
47465
  /**
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`.
47466
+ * Adds legends for each group in `groups` array, iterating through each series
47467
+ * within the group in reverse order. This ensures the legends align with the series
47468
+ * order as displayed in the chart. Only adds series with `showLegend` set to `true`.
47579
47469
  *
47580
47470
  * @param {Array} groups - Array of groups containing series identifiers.
47581
47471
  * @param {Object} seriesList - Object containing all series, keyed by series ID.
@@ -47586,7 +47476,7 @@ var plugins_legend_modules = {
47586
47476
  var _this5 = this;
47587
47477
 
47588
47478
  groups.forEach(function (group) {
47589
- group.forEach(function (sId) {
47479
+ group.slice().reverse().forEach(function (sId) {
47590
47480
  var series = seriesList[sId];
47591
47481
 
47592
47482
  if (series && series.showLegend) {
@@ -50701,7 +50591,7 @@ function toFinite(value) {
50701
50591
  * _.inRange(-3, -2, -6);
50702
50592
  * // => true
50703
50593
  */
50704
- function inRange(number, start, end) {
50594
+ function inRange_inRange(number, start, end) {
50705
50595
  start = lodash_es_toFinite(start);
50706
50596
  if (end === undefined) {
50707
50597
  end = start;
@@ -50713,7 +50603,7 @@ function inRange(number, start, end) {
50713
50603
  return _baseInRange(number, start, end);
50714
50604
  }
50715
50605
 
50716
- /* harmony default export */ var lodash_es_inRange = (inRange);
50606
+ /* harmony default export */ var lodash_es_inRange = (inRange_inRange);
50717
50607
 
50718
50608
  // CONCATENATED MODULE: ./src/components/chart/plugins/plugins.interaction.js
50719
50609
 
@@ -50732,13 +50622,6 @@ function inRange(number, start, end) {
50732
50622
 
50733
50623
 
50734
50624
 
50735
-
50736
-
50737
-
50738
-
50739
-
50740
-
50741
-
50742
50625
 
50743
50626
 
50744
50627
 
@@ -50829,6 +50712,29 @@ var plugins_interaction_modules = {
50829
50712
  _this.drawTooltip(hitInfo, _this.tooltipCtx);
50830
50713
  }
50831
50714
  }
50715
+ } // tooltip이 표시될 때 indicator를 해당 라벨 위치로 이동 (line 차트이거나 line series가 포함된 경우)
50716
+
50717
+
50718
+ var hasLineSeries = Object.values(_this.seriesList || {}).some(function (series) {
50719
+ return series.type === 'line';
50720
+ });
50721
+
50722
+ if (tooltip.use && (type === 'line' || hasLineSeries)) {
50723
+ // indicator를 그리고 실제 위치한 라벨 정보를 받음
50724
+ var indicatorInfo = _this.drawIndicatorForTooltip(hitInfo, indicator.color); // 실제 indicator가 위치한 라벨 값을 동기화에 사용
50725
+
50726
+
50727
+ var actualLabelValue = indicatorInfo === null || indicatorInfo === void 0 ? void 0 : indicatorInfo.labelValue;
50728
+
50729
+ var label = _this.getTimeLabel(offset);
50730
+
50731
+ args.hoveredLabel = {
50732
+ horizontal: _this.options.horizontal,
50733
+ label: label,
50734
+ mousePosition: [e.clientX, e.clientY],
50735
+ dataLabel: actualLabelValue,
50736
+ isTooltipBased: true
50737
+ };
50832
50738
  }
50833
50739
  } else if (tooltip.use && _this.isInitTooltip) {
50834
50740
  if (typeof (tooltip === null || tooltip === void 0 ? void 0 : tooltip.returnValue) === 'function') {
@@ -50840,35 +50746,28 @@ var plugins_interaction_modules = {
50840
50746
 
50841
50747
  if (_this.dragInfoBackup) {
50842
50748
  _this.drawSelectionArea(_this.dragInfoBackup);
50843
- }
50844
-
50845
- if (indicator.use && type !== 'pie' && type !== 'scatter' && type !== 'heatMap') {
50846
- // Use data point position instead of mouse position for indicator when tooltip is enabled
50847
- var indicatorOffset = offset;
50848
-
50849
- var label = _this.getTimeLabel(offset);
50749
+ } // tooltip 기반 indicator가 아직 설정되지 않은 경우에만 일반 indicator 처리
50850
50750
 
50851
- var useAxisTrigger = tooltip.use && tooltip.trigger === 'axis' && type === 'line';
50852
50751
 
50853
- if (useAxisTrigger && Object.keys(hitInfo.items).length) {
50854
- var hitId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
50855
- var hitItem = hitInfo.items[hitId];
50752
+ if (!args.hoveredLabel && type !== 'pie' && type !== 'scatter' && type !== 'heatMap') {
50753
+ // line 차트가 아니고 line series가 없거나, tooltip이 없을 때는 일반 indicator 표시
50754
+ var _hasLineSeries = Object.values(_this.seriesList || {}).some(function (series) {
50755
+ return series.type === 'line';
50756
+ });
50856
50757
 
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
- }
50758
+ if (type !== 'line' && !_hasLineSeries || !tooltip.use || !Object.keys(hitInfo.items).length) {
50759
+ _this.drawIndicator(offset, indicator.color);
50861
50760
  }
50862
50761
 
50863
- _this.drawIndicator(indicatorOffset, indicator.color);
50762
+ var _label = _this.getTimeLabel(offset);
50864
50763
 
50865
50764
  args.hoveredLabel = {
50866
50765
  horizontal: _this.options.horizontal,
50867
- label: label,
50766
+ label: _label,
50868
50767
  mousePosition: [e.clientX, e.clientY],
50869
- useAxisTrigger: useAxisTrigger
50768
+ isTooltipBased: false
50870
50769
  };
50871
- } else {
50770
+ } else if (!args.hoveredLabel) {
50872
50771
  args.hoveredLabel = {
50873
50772
  label: ''
50874
50773
  };
@@ -51726,19 +51625,11 @@ var plugins_interaction_modules = {
51726
51625
  }
51727
51626
  },
51728
51627
 
51729
- /**
51730
- * @typedef {object} HitInfo
51731
- * @property {object} items
51732
- * @property {string} hitId
51733
- * @property {object} maxTip
51734
- * @property {object} maxHighlight
51735
- */
51736
-
51737
51628
  /**
51738
51629
  * Find graph item on mouse position
51739
51630
  * @param {array} offset return value from getMousePosition()
51740
51631
  *
51741
- * @returns {HitInfo} hit item information
51632
+ * @returns {object} hit item information
51742
51633
  */
51743
51634
  findHitItem: function findHitItem(offset) {
51744
51635
  var _this4 = this;
@@ -51746,122 +51637,160 @@ var plugins_interaction_modules = {
51746
51637
  var sIds = Object.keys(this.seriesList);
51747
51638
  var items = {};
51748
51639
  var isHorizontal = !!this.options.horizontal;
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
51640
+ var ctx = this.tooltipCtx;
51641
+ var hitId = null;
51642
+ var maxs = '';
51643
+ var maxsw = 0;
51644
+ var maxv = '';
51645
+ var maxg = null;
51646
+ var maxSID = null; // 파이 차트는 특별한 처리가 필요
51754
51647
 
51648
+ if (this.options.type === 'pie') {
51649
+ for (var ix = 0; ix < sIds.length; ix++) {
51650
+ var sId = sIds[ix];
51651
+ var series = this.seriesList[sId];
51755
51652
 
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)
51653
+ if (series.findGraphData && series.show) {
51654
+ var item = series.findGraphData(offset);
51758
51655
 
51759
- entries.sort(function (_ref2, _ref3) {
51760
- var _ref4 = _slicedToArray(_ref2, 1),
51761
- keyA = _ref4[0];
51656
+ if (item !== null && item !== void 0 && item.data && item.hit) {
51657
+ var gdata = item.data.o;
51762
51658
 
51763
- var _ref5 = _slicedToArray(_ref3, 1),
51764
- keyB = _ref5[0];
51659
+ if (gdata !== null && gdata !== undefined) {
51660
+ var formattedSeriesName = this.getFormattedTooltipLabel({
51661
+ dataId: series.id,
51662
+ seriesId: sId,
51663
+ seriesName: series.name,
51664
+ itemData: item.data
51665
+ });
51666
+ var sw = ctx ? ctx.measureText(formattedSeriesName).width : 1;
51667
+ item.id = series.id;
51668
+ item.name = formattedSeriesName;
51669
+ item.axis = {
51670
+ x: 0,
51671
+ y: 0
51672
+ };
51673
+ items[sId] = item;
51674
+ var formattedTxt = this.getFormattedTooltipValue({
51675
+ dataId: series.id,
51676
+ seriesId: sId,
51677
+ seriesName: formattedSeriesName,
51678
+ value: gdata,
51679
+ itemData: item.data
51680
+ });
51681
+ item.data.formatted = formattedTxt;
51765
51682
 
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)
51683
+ if (maxsw < sw) {
51684
+ maxs = formattedSeriesName;
51685
+ maxsw = sw;
51686
+ }
51770
51687
 
51771
- this._measureTextCache.clear();
51688
+ if (maxv.length <= "".concat(formattedTxt).length) {
51689
+ maxv = "".concat(formattedTxt);
51690
+ }
51772
51691
 
51773
- entries.slice(0, 500).forEach(function (_ref6) {
51774
- var _ref7 = _slicedToArray(_ref6, 2),
51775
- key = _ref7[0],
51776
- value = _ref7[1];
51692
+ if (maxg === null || maxg <= gdata) {
51693
+ maxg = gdata;
51694
+ maxSID = sId;
51695
+ }
51777
51696
 
51778
- _this4._measureTextCache.set(key, value);
51779
- });
51780
- }
51697
+ hitId = sId;
51698
+ }
51699
+ }
51700
+ }
51701
+ }
51781
51702
 
51782
- var hitId = null;
51783
- var maxs = '';
51784
- var maxsw = 0;
51785
- var maxv = '';
51786
- var maxg = null;
51787
- var maxSID = null;
51703
+ var _maxHighlight2 = maxg !== null ? [maxSID, maxg] : null;
51788
51704
 
51789
- for (var ix = 0; ix < sIds.length; ix++) {
51790
- var sId = sIds[ix];
51791
- var series = this.seriesList[sId]; // Skip hidden series for performance
51705
+ return {
51706
+ items: items,
51707
+ hitId: hitId,
51708
+ maxTip: [maxs, maxv],
51709
+ maxHighlight: _maxHighlight2
51710
+ };
51711
+ } // 1. 먼저 공통으로 사용할 데이터 인덱스 결정
51792
51712
 
51793
- if (!series.show || !series.findGraphData) {
51794
- // eslint-disable-next-line no-continue
51795
- continue;
51796
- }
51797
51713
 
51798
- var item = series.findGraphData(offset, isHorizontal);
51714
+ var targetDataIndex = this.findClosestDataIndex(offset, sIds);
51799
51715
 
51800
- if (item !== null && item !== void 0 && item.data) {
51801
- var gdata = void 0;
51716
+ if (targetDataIndex === -1) {
51717
+ return {
51718
+ items: items,
51719
+ hitId: hitId,
51720
+ maxTip: [maxs, maxv],
51721
+ maxHighlight: null
51722
+ };
51723
+ } // 2. 모든 시리즈가 동일한 데이터 인덱스 사용
51802
51724
 
51803
- if (item.data.o === null && series.interpolation !== 'zero') {
51804
- if (!series.isExistGrp) {
51805
- gdata = isHorizontal ? item.data.x : item.data.y;
51806
- }
51807
- } else if (!isNaN(item.data.o)) {
51808
- gdata = item.data.o;
51809
- }
51810
51725
 
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
51726
+ var allSeriesIsBar = sIds.every(function (sId) {
51727
+ return _this4.seriesList[sId].type === 'bar';
51728
+ });
51818
51729
 
51819
- var sw = 1;
51730
+ for (var _ix = 0; _ix < sIds.length; _ix++) {
51731
+ var _sId = sIds[_ix];
51732
+ var _series = this.seriesList[_sId];
51820
51733
 
51821
- if (ctx) {
51822
- var cacheKey = "".concat(formattedSeriesName, "-").concat(ctx.font);
51734
+ if (_series.findGraphData && _series.show) {
51735
+ // 특정 데이터 인덱스로 데이터 요청
51736
+ var _item = _series.findGraphData(offset, isHorizontal, targetDataIndex, !allSeriesIsBar);
51823
51737
 
51824
- if (this._measureTextCache.has(cacheKey)) {
51825
- sw = this._measureTextCache.get(cacheKey);
51826
- } else {
51827
- sw = ctx.measureText(formattedSeriesName).width;
51738
+ if (_item !== null && _item !== void 0 && _item.data) {
51739
+ var _gdata = void 0;
51828
51740
 
51829
- this._measureTextCache.set(cacheKey, sw);
51741
+ if (_item.data.o === null && _series.interpolation !== 'zero') {
51742
+ if (!_series.isExistGrp) {
51743
+ _gdata = isHorizontal ? _item.data.x : _item.data.y;
51830
51744
  }
51745
+ } else if (!isNaN(_item.data.o)) {
51746
+ _gdata = _item.data.o;
51831
51747
  }
51832
51748
 
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;
51749
+ if (_gdata !== null && _gdata !== undefined) {
51750
+ var _formattedSeriesName = this.getFormattedTooltipLabel({
51751
+ dataId: _series.id,
51752
+ seriesId: _sId,
51753
+ seriesName: _series.name,
51754
+ itemData: _item.data
51755
+ });
51848
51756
 
51849
- if (maxsw < sw) {
51850
- maxs = formattedSeriesName;
51851
- maxsw = sw;
51852
- }
51757
+ var _sw = ctx ? ctx.measureText(_formattedSeriesName).width : 1;
51853
51758
 
51854
- if (maxv.length <= "".concat(formattedTxt).length) {
51855
- maxv = "".concat(formattedTxt);
51856
- }
51759
+ _item.id = _series.id;
51760
+ _item.name = _formattedSeriesName;
51761
+ _item.axis = {
51762
+ x: _series.xAxisIndex,
51763
+ y: _series.yAxisIndex
51764
+ };
51765
+ items[_sId] = _item;
51766
+
51767
+ var _formattedTxt = this.getFormattedTooltipValue({
51768
+ dataId: _series.id,
51769
+ seriesId: _sId,
51770
+ seriesName: _formattedSeriesName,
51771
+ value: _gdata,
51772
+ itemData: _item.data
51773
+ });
51857
51774
 
51858
- if (maxg === null || maxg <= gdata) {
51859
- maxg = gdata;
51860
- maxSID = sId;
51861
- }
51775
+ _item.data.formatted = _formattedTxt;
51862
51776
 
51863
- if (item.hit) {
51864
- hitId = sId;
51777
+ if (maxsw < _sw) {
51778
+ maxs = _formattedSeriesName;
51779
+ maxsw = _sw;
51780
+ }
51781
+
51782
+ if (maxv.length <= "".concat(_formattedTxt).length) {
51783
+ maxv = "".concat(_formattedTxt);
51784
+ }
51785
+
51786
+ if (maxg === null || maxg <= _gdata) {
51787
+ maxg = _gdata;
51788
+ maxSID = _sId;
51789
+ }
51790
+
51791
+ if (_item.hit) {
51792
+ hitId = _sId;
51793
+ }
51865
51794
  }
51866
51795
  }
51867
51796
  }
@@ -51877,6 +51806,78 @@ var plugins_interaction_modules = {
51877
51806
  };
51878
51807
  },
51879
51808
 
51809
+ /**
51810
+ * Find the closest data index (label) based on mouse position
51811
+ * @param {array} offset mouse position
51812
+ * @param {array} sIds series IDs
51813
+ * @returns {number} closest data index
51814
+ */
51815
+ findClosestDataIndex: function findClosestDataIndex(offset, sIds) {
51816
+ var _this5 = this,
51817
+ _this$seriesList$refe;
51818
+
51819
+ var _offset = _slicedToArray(offset, 2),
51820
+ xp = _offset[0],
51821
+ yp = _offset[1];
51822
+
51823
+ var isHorizontal = !!this.options.horizontal;
51824
+ var mousePos = isHorizontal ? yp : xp;
51825
+ var closestDistance = Infinity;
51826
+ var closestIndex = -1; // 첫 번째 표시 중인 시리즈를 기준으로 라벨 위치 확인
51827
+
51828
+ var referenceSeries = sIds.find(function (sId) {
51829
+ var _this5$seriesList$sId;
51830
+
51831
+ return (_this5$seriesList$sId = _this5.seriesList[sId]) === null || _this5$seriesList$sId === void 0 ? void 0 : _this5$seriesList$sId.show;
51832
+ });
51833
+
51834
+ if (!referenceSeries || !((_this$seriesList$refe = this.seriesList[referenceSeries]) !== null && _this$seriesList$refe !== void 0 && _this$seriesList$refe.data)) {
51835
+ return -1;
51836
+ }
51837
+
51838
+ var referenceData = this.seriesList[referenceSeries].data; // 각 라벨에서 가장 가까운 것 찾기
51839
+
51840
+ var _loop = function _loop(i) {
51841
+ // 이 라벨에 유효한 데이터가 있는 시리즈가 하나 이상 있는지 확인
51842
+ var hasValidData = sIds.some(function (sId) {
51843
+ var _series$data, _series$data$i, _series$data2, _series$data2$i;
51844
+
51845
+ var series = _this5.seriesList[sId];
51846
+ return (series === null || series === void 0 ? void 0 : series.show) && ((_series$data = series.data) === null || _series$data === void 0 ? void 0 : (_series$data$i = _series$data[i]) === null || _series$data$i === void 0 ? void 0 : _series$data$i.o) !== null && ((_series$data2 = series.data) === null || _series$data2 === void 0 ? void 0 : (_series$data2$i = _series$data2[i]) === null || _series$data2$i === void 0 ? void 0 : _series$data2$i.o) !== undefined;
51847
+ });
51848
+
51849
+ if (hasValidData) {
51850
+ var point = referenceData[i];
51851
+
51852
+ if (point) {
51853
+ // 라벨 위치 계산
51854
+ var labelPos;
51855
+
51856
+ if (isHorizontal) {
51857
+ labelPos = point.h ? point.yp + point.h / 2 : point.yp;
51858
+ } else {
51859
+ labelPos = point.w ? point.xp + point.w / 2 : point.xp;
51860
+ }
51861
+
51862
+ if (labelPos !== null) {
51863
+ var distance = Math.abs(mousePos - labelPos);
51864
+
51865
+ if (distance < closestDistance) {
51866
+ closestDistance = distance;
51867
+ closestIndex = i;
51868
+ }
51869
+ }
51870
+ }
51871
+ }
51872
+ };
51873
+
51874
+ for (var i = 0; i < referenceData.length; i++) {
51875
+ _loop(i);
51876
+ }
51877
+
51878
+ return closestIndex;
51879
+ },
51880
+
51880
51881
  /**
51881
51882
  * get formatted label for tooltip
51882
51883
  * @param dataId
@@ -51885,13 +51886,13 @@ var plugins_interaction_modules = {
51885
51886
  * @param itemData
51886
51887
  * @returns {string}
51887
51888
  */
51888
- getFormattedTooltipLabel: function getFormattedTooltipLabel(_ref8) {
51889
+ getFormattedTooltipLabel: function getFormattedTooltipLabel(_ref2) {
51889
51890
  var _tooltipOpt$formatter;
51890
51891
 
51891
- var dataId = _ref8.dataId,
51892
- seriesId = _ref8.seriesId,
51893
- seriesName = _ref8.seriesName,
51894
- itemData = _ref8.itemData;
51892
+ var dataId = _ref2.dataId,
51893
+ seriesId = _ref2.seriesId,
51894
+ seriesName = _ref2.seriesName,
51895
+ itemData = _ref2.itemData;
51895
51896
  var opt = this.options;
51896
51897
  var tooltipOpt = opt.tooltip;
51897
51898
  var tooltipLabelFormatter = tooltipOpt === null || tooltipOpt === void 0 ? void 0 : (_tooltipOpt$formatter = tooltipOpt.formatter) === null || _tooltipOpt$formatter === void 0 ? void 0 : _tooltipOpt$formatter.label;
@@ -51918,14 +51919,14 @@ var plugins_interaction_modules = {
51918
51919
  * @param itemData
51919
51920
  * @returns {string}
51920
51921
  */
51921
- getFormattedTooltipValue: function getFormattedTooltipValue(_ref9) {
51922
+ getFormattedTooltipValue: function getFormattedTooltipValue(_ref3) {
51922
51923
  var _tooltipOpt$formatter2;
51923
51924
 
51924
- var dataId = _ref9.dataId,
51925
- seriesId = _ref9.seriesId,
51926
- seriesName = _ref9.seriesName,
51927
- value = _ref9.value,
51928
- itemData = _ref9.itemData;
51925
+ var dataId = _ref3.dataId,
51926
+ seriesId = _ref3.seriesId,
51927
+ seriesName = _ref3.seriesName,
51928
+ value = _ref3.value,
51929
+ itemData = _ref3.itemData;
51929
51930
  var opt = this.options;
51930
51931
  var isHorizontal = !!opt.horizontal;
51931
51932
  var tooltipOpt = opt.tooltip;
@@ -52006,9 +52007,9 @@ var plugins_interaction_modules = {
52006
52007
  seriesName: formattedSeriesName,
52007
52008
  value: hasData === null || hasData === void 0 ? void 0 : hasData.o,
52008
52009
  itemData: hasData
52009
- });
52010
+ }); // Only add data if there's a valid value for this exact label
52010
52011
 
52011
- if (hasData && !hitInfo.items[sId]) {
52012
+ if (hasData && hasData.o !== null && hasData.o !== undefined && !hitInfo.items[sId]) {
52012
52013
  var item = {};
52013
52014
  item.color = series.color;
52014
52015
  item.hit = false;
@@ -52098,7 +52099,7 @@ var plugins_interaction_modules = {
52098
52099
  * @returns {object[]}
52099
52100
  */
52100
52101
  getSelectedLabelInfoWithLabelData: function getSelectedLabelInfoWithLabelData(labelIndexList, targetAxis) {
52101
- var _this5 = this;
52102
+ var _this6 = this;
52102
52103
 
52103
52104
  var _this$options9 = this.options,
52104
52105
  selectLabelOpt = _this$options9.selectLabel,
@@ -52114,14 +52115,14 @@ var plugins_interaction_modules = {
52114
52115
  {
52115
52116
  result.dataIndex.splice(selectLabelOpt.limit);
52116
52117
  result.label = result.dataIndex.map(function (i) {
52117
- return _this5.data.labels[i];
52118
+ return _this6.data.labels[i];
52118
52119
  });
52119
52120
  var dataEntries = Object.entries(this.data.data);
52120
52121
  result.data = result.dataIndex.map(function (labelIdx) {
52121
- return Object.fromEntries(dataEntries.map(function (_ref10) {
52122
- var _ref11 = _slicedToArray(_ref10, 2),
52123
- sId = _ref11[0],
52124
- data = _ref11[1];
52122
+ return Object.fromEntries(dataEntries.map(function (_ref4) {
52123
+ var _ref5 = _slicedToArray(_ref4, 2),
52124
+ sId = _ref5[0],
52125
+ data = _ref5[1];
52125
52126
 
52126
52127
  return [sId, data[labelIdx]];
52127
52128
  }));
@@ -52144,12 +52145,12 @@ var plugins_interaction_modules = {
52144
52145
  }
52145
52146
 
52146
52147
  result.label = result.dataIndex.map(function (i) {
52147
- return _this5.data.labels[targetAxisDirection][i];
52148
+ return _this6.data.labels[targetAxisDirection][i];
52148
52149
  });
52149
52150
  var dataValues = Object.values(this.data.data)[0];
52150
- result.data = dataValues.filter(function (_ref12) {
52151
- var x = _ref12.x,
52152
- y = _ref12.y;
52151
+ result.data = dataValues.filter(function (_ref6) {
52152
+ var x = _ref6.x,
52153
+ y = _ref6.y;
52153
52154
  return result.label.includes(targetAxisDirection === 'y' ? y : x);
52154
52155
  });
52155
52156
  break;
@@ -52235,6 +52236,76 @@ var plugins_interaction_modules = {
52235
52236
  return after;
52236
52237
  },
52237
52238
 
52239
+ /**
52240
+ * Draw indicator at the label position when tooltip is displayed
52241
+ * @param {object} hitInfo hit item information from findHitItem
52242
+ * @param {string} color indicator color
52243
+ * @returns {object|null} indicator position info with actual label value
52244
+ */
52245
+ drawIndicatorForTooltip: function drawIndicatorForTooltip(hitInfo, color) {
52246
+ var _this$options$indicat;
52247
+
52248
+ if (!(hitInfo !== null && hitInfo !== void 0 && hitInfo.items) || !Object.keys(hitInfo.items).length) {
52249
+ return null;
52250
+ }
52251
+
52252
+ var ctx = this.overlayCtx;
52253
+ var horizontal = this.options.horizontal;
52254
+ var graphPos = {
52255
+ x1: this.chartRect.x1 + this.labelOffset.left,
52256
+ x2: this.chartRect.x2 - this.labelOffset.right,
52257
+ y1: this.chartRect.y1 + this.labelOffset.top,
52258
+ y2: this.chartRect.y2 - this.labelOffset.bottom
52259
+ }; // 첫 번째 시리즈의 데이터를 기준으로 라벨 위치 계산
52260
+
52261
+ var firstSeriesId = Object.keys(hitInfo.items)[0];
52262
+ var firstItem = hitInfo.items[firstSeriesId];
52263
+
52264
+ if (!(firstItem !== null && firstItem !== void 0 && firstItem.data)) {
52265
+ return null;
52266
+ } // 실제 indicator가 위치하는 라벨 값 추출
52267
+
52268
+
52269
+ var actualLabelValue = horizontal ? firstItem.data.y : firstItem.data.x;
52270
+ var indicatorPosition;
52271
+
52272
+ if (horizontal) {
52273
+ // 수평 차트에서는 Y축 라벨 위치에 수평선
52274
+ var yPosition = firstItem.data.yp + (firstItem.data.h ? firstItem.data.h / 2 : 0);
52275
+ indicatorPosition = [graphPos.x1, yPosition];
52276
+ } else {
52277
+ // 수직 차트에서는 X축 라벨 위치에 수직선
52278
+ var xPosition = firstItem.data.xp + (firstItem.data.w ? firstItem.data.w / 2 : 0);
52279
+ indicatorPosition = [xPosition, graphPos.y1];
52280
+ }
52281
+
52282
+ ctx.beginPath();
52283
+ ctx.save();
52284
+ ctx.strokeStyle = color;
52285
+ ctx.lineWidth = 1;
52286
+
52287
+ if ((_this$options$indicat = this.options.indicator) !== null && _this$options$indicat !== void 0 && _this$options$indicat.segments) {
52288
+ ctx.setLineDash(this.options.indicator.segments);
52289
+ }
52290
+
52291
+ if (horizontal) {
52292
+ ctx.moveTo(graphPos.x1, indicatorPosition[1] + 0.5);
52293
+ ctx.lineTo(graphPos.x2, indicatorPosition[1] + 0.5);
52294
+ } else {
52295
+ ctx.moveTo(indicatorPosition[0] + 0.5, graphPos.y1);
52296
+ ctx.lineTo(indicatorPosition[0] + 0.5, graphPos.y2);
52297
+ }
52298
+
52299
+ ctx.stroke();
52300
+ ctx.restore();
52301
+ ctx.closePath(); // 실제 indicator가 위치한 라벨 정보 반환
52302
+
52303
+ return {
52304
+ labelValue: actualLabelValue,
52305
+ position: indicatorPosition
52306
+ };
52307
+ },
52308
+
52238
52309
  /**
52239
52310
  * Find items by series within a range
52240
52311
  * @param {object} range object for find series items
@@ -52272,14 +52343,14 @@ var plugins_interaction_modules = {
52272
52343
  * object.range: coordinate-based range in graph
52273
52344
  * @returns {object}
52274
52345
  */
52275
- getSelectionRange: function getSelectionRange(_ref13) {
52346
+ getSelectionRange: function getSelectionRange(_ref7) {
52276
52347
  var _this$boxOverflow, _this$boxOverflow2, _this$boxOverflow3, _this$boxOverflow4;
52277
52348
 
52278
- var xsp = _ref13.xsp,
52279
- ysp = _ref13.ysp,
52280
- width = _ref13.width,
52281
- height = _ref13.height,
52282
- range = _ref13.range;
52349
+ var xsp = _ref7.xsp,
52350
+ ysp = _ref7.ysp,
52351
+ width = _ref7.width,
52352
+ height = _ref7.height,
52353
+ range = _ref7.range;
52283
52354
  var dataRangeX = this.axesSteps.x.length ? this.axesSteps.x[0] : null;
52284
52355
  var dataRangeY = this.axesSteps.y.length ? this.axesSteps.y[0] : null;
52285
52356
 
@@ -52336,11 +52407,11 @@ var plugins_interaction_modules = {
52336
52407
 
52337
52408
  var sId = Object.keys(this.seriesList)[0];
52338
52409
 
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;
52410
+ var _ref8 = (_this$seriesList$sId$ = this.seriesList[sId].findSelectionRange(range)) !== null && _this$seriesList$sId$ !== void 0 ? _this$seriesList$sId$ : {},
52411
+ xMin = _ref8.xMin,
52412
+ xMax = _ref8.xMax,
52413
+ yMin = _ref8.yMin,
52414
+ yMax = _ref8.yMax;
52344
52415
 
52345
52416
  return {
52346
52417
  xMin: xMin !== null && xMin !== void 0 ? xMin : dataRangeX.graphMin,
@@ -52367,9 +52438,9 @@ var plugins_interaction_modules = {
52367
52438
  * @returns {string}
52368
52439
  */
52369
52440
  getCurMouseLocation: function getCurMouseLocation(offset) {
52370
- var _offset = _slicedToArray(offset, 2),
52371
- offsetX = _offset[0],
52372
- offsetY = _offset[1];
52441
+ var _offset2 = _slicedToArray(offset, 2),
52442
+ offsetX = _offset2[0],
52443
+ offsetY = _offset2[1];
52373
52444
 
52374
52445
  var aPos = {
52375
52446
  x1: this.chartRect.x1 + this.labelOffset.left,
@@ -52430,6 +52501,7 @@ var plugins_interaction_modules = {
52430
52501
 
52431
52502
 
52432
52503
 
52504
+
52433
52505
 
52434
52506
  var LINE_SPACING = 8;
52435
52507
  var VALUE_MARGIN = 50;
@@ -53221,9 +53293,10 @@ var plugins_tooltip_modules = {
53221
53293
  y1: this.chartRect.y1 + this.labelOffset.top,
53222
53294
  y2: this.chartRect.y2 - this.labelOffset.bottom
53223
53295
  };
53224
- var mouseXIp = 5; // mouseInterpolation - increased for better edge detection
53296
+ var mouseXIp = 15; // mouseInterpolation - 넓은 범위에서 감지
53297
+
53298
+ var mouseYIp = 15; // Y축도 동일하게 증가
53225
53299
 
53226
- var mouseYIp = 10;
53227
53300
  var options = this.options;
53228
53301
 
53229
53302
  if (offsetX >= graphPos.x1 - mouseXIp && offsetX <= graphPos.x2 + mouseXIp && offsetY >= graphPos.y1 - mouseYIp && offsetY <= graphPos.y2 + mouseYIp) {
@@ -53318,11 +53391,22 @@ var plugins_tooltip_modules = {
53318
53391
  var horizontal = _ref5.horizontal,
53319
53392
  label = _ref5.label,
53320
53393
  mousePosition = _ref5.mousePosition,
53321
- useAxisTrigger = _ref5.useAxisTrigger;
53394
+ dataLabel = _ref5.dataLabel,
53395
+ isTooltipBased = _ref5.isTooltipBased;
53322
53396
 
53323
53397
  if (!mousePosition || !!horizontal !== !!this.options.horizontal) {
53324
53398
  return;
53325
- }
53399
+ } // tooltip 기반 동기화인 경우
53400
+
53401
+
53402
+ if (isTooltipBased) {
53403
+ this.drawSyncedIndicatorForTooltip({
53404
+ dataLabel: dataLabel,
53405
+ mousePosition: mousePosition
53406
+ });
53407
+ return;
53408
+ } // 기존 시간 기반 동기화
53409
+
53326
53410
 
53327
53411
  if (this.options.syncHover === false || !horizontal && !this.options.axesX.every(function (_ref6) {
53328
53412
  var type = _ref6.type;
@@ -53365,25 +53449,7 @@ var plugins_tooltip_modules = {
53365
53449
  y2: this.chartRect.y2 - this.labelOffset.bottom
53366
53450
  };
53367
53451
 
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) {
53452
+ if (horizontal) {
53387
53453
  var chartHeight = graphPos.y2 - graphPos.y1;
53388
53454
  var offsetY = chartHeight * (label - fromTime) / (toTime - fromTime) + graphPos.y1;
53389
53455
  this.drawIndicator([graphPos.x2, offsetY], this.options.indicator.color);
@@ -53394,6 +53460,82 @@ var plugins_tooltip_modules = {
53394
53460
  }
53395
53461
  },
53396
53462
 
53463
+ /**
53464
+ * 제공된 dataLabel과 일치하는 Label이 있다면 indicator를 그림
53465
+ * @param {object} dataLabel data label
53466
+ * @param {object} mousePosition mouse position
53467
+ *
53468
+ * @returns {undefined}
53469
+ */
53470
+ drawSyncedIndicatorForTooltip: function drawSyncedIndicatorForTooltip(_ref8) {
53471
+ var _this$data;
53472
+
53473
+ var dataLabel = _ref8.dataLabel,
53474
+ mousePosition = _ref8.mousePosition;
53475
+
53476
+ if (!((_this$data = this.data) !== null && _this$data !== void 0 && _this$data.labels) || !dataLabel) {
53477
+ return;
53478
+ }
53479
+
53480
+ var matchingLabelIndex = this.data.labels.findIndex(function (label) {
53481
+ return (label === null || label === void 0 ? void 0 : label.valueOf()) === (dataLabel === null || dataLabel === void 0 ? void 0 : dataLabel.valueOf());
53482
+ });
53483
+
53484
+ if (matchingLabelIndex === -1) {
53485
+ this.overlayClear();
53486
+ return;
53487
+ }
53488
+
53489
+ var horizontal = this.options.horizontal;
53490
+
53491
+ var _this$chartDOM$getBou2 = this.chartDOM.getBoundingClientRect(),
53492
+ top = _this$chartDOM$getBou2.top,
53493
+ bottom = _this$chartDOM$getBou2.bottom,
53494
+ left = _this$chartDOM$getBou2.left,
53495
+ right = _this$chartDOM$getBou2.right;
53496
+
53497
+ var isHoveredChart = lodash_es_inRange(mousePosition[0], left, right) && lodash_es_inRange(mousePosition[1], bottom, top);
53498
+
53499
+ if (isHoveredChart) {
53500
+ return;
53501
+ }
53502
+
53503
+ this.overlayClear();
53504
+ var graphPos = {
53505
+ x1: this.chartRect.x1 + this.labelOffset.left,
53506
+ x2: this.chartRect.x2 - this.labelOffset.right,
53507
+ y1: this.chartRect.y1 + this.labelOffset.top,
53508
+ y2: this.chartRect.y2 - this.labelOffset.bottom
53509
+ };
53510
+ var labelsCount = this.data.labels.length;
53511
+ var indicatorPosition;
53512
+
53513
+ if (horizontal) {
53514
+ var _this$options$axesY;
53515
+
53516
+ var chartHeight = graphPos.y2 - graphPos.y1; // CategoryMode인 경우 라벨들이 균등 간격으로 배치됨
53517
+
53518
+ var isCategoryMode = (_this$options$axesY = this.options.axesY) === null || _this$options$axesY === void 0 ? void 0 : _this$options$axesY.some(function (axis) {
53519
+ return axis.categoryMode;
53520
+ });
53521
+ var positionY = isCategoryMode ? graphPos.y1 + chartHeight * (matchingLabelIndex + 0.5) / labelsCount : graphPos.y1 + chartHeight * matchingLabelIndex / (labelsCount - 1);
53522
+ indicatorPosition = [graphPos.x2, positionY];
53523
+ } else {
53524
+ var _this$options$axesX;
53525
+
53526
+ var chartWidth = graphPos.x2 - graphPos.x1; // CategoryMode인 경우 라벨들이 균등 간격으로 배치됨
53527
+
53528
+ var _isCategoryMode = (_this$options$axesX = this.options.axesX) === null || _this$options$axesX === void 0 ? void 0 : _this$options$axesX.some(function (axis) {
53529
+ return axis.categoryMode;
53530
+ });
53531
+
53532
+ var positionX = _isCategoryMode ? graphPos.x1 + chartWidth * (matchingLabelIndex + 0.5) / labelsCount : graphPos.x1 + chartWidth * matchingLabelIndex / (labelsCount - 1);
53533
+ indicatorPosition = [positionX, graphPos.y2];
53534
+ }
53535
+
53536
+ this.drawIndicator(indicatorPosition, this.options.indicator.color);
53537
+ },
53538
+
53397
53539
  /**
53398
53540
  * Clear tooltip canvas
53399
53541
  *
@@ -53734,6 +53876,7 @@ var plugins_pie_modules = {
53734
53876
 
53735
53877
 
53736
53878
 
53879
+
53737
53880
  var element_tip_modules = {
53738
53881
  /**
53739
53882
  * Draw TextTip with tip's locationInfo
@@ -53767,7 +53910,8 @@ var element_tip_modules = {
53767
53910
  }
53768
53911
 
53769
53912
  if (labelTipOpt.use && labelTipOpt.showTip) {
53770
- isExistSelectedLabel = opt.type === 'heatMap' ? this.drawLabelTipForHeatMap() : this.drawTipForSelectedLabel();
53913
+ var isHeatMap = opt.type === 'heatMap';
53914
+ isExistSelectedLabel = isHeatMap ? this.drawLabelTipForHeatMap() : this.drawLabelTip();
53771
53915
  }
53772
53916
 
53773
53917
  var executeDrawIndicator = function executeDrawIndicator(tipOpt) {
@@ -54053,10 +54197,9 @@ var element_tip_modules = {
54053
54197
 
54054
54198
  /**
54055
54199
  * Draw Selected Label Tip
54056
- * none Text
54057
54200
  * @returns {boolean} Whether drew at least one tip
54058
54201
  */
54059
- drawTipForSelectedLabel: function drawTipForSelectedLabel() {
54202
+ drawLabelTip: function drawLabelTip() {
54060
54203
  var _this2 = this;
54061
54204
 
54062
54205
  var opt = this.options;
@@ -54082,7 +54225,7 @@ var element_tip_modules = {
54082
54225
  };
54083
54226
  var labelAxes = isHorizontal ? this.axesY[0] : this.axesX[0];
54084
54227
  var valueAxes = isHorizontal ? this.axesX[0] : this.axesY[0];
54085
- var valueAxesSteps = isHorizontal ? this.axesSteps.x[0] : this.axesSteps.y[0];
54228
+ var valueAxesRange = isHorizontal ? this.axesRange.x[0] : this.axesRange.y[0];
54086
54229
  var valuePositionCalcFunction = isHorizontal ? helpers_canvas.calculateX : helpers_canvas.calculateY;
54087
54230
  var labelPositionCalcFunction = isHorizontal ? helpers_canvas.calculateY : helpers_canvas.calculateX;
54088
54231
  var scrollbarOpt = isHorizontal ? this.scrollbar.y : this.scrollbar.x;
@@ -54100,8 +54243,8 @@ var element_tip_modules = {
54100
54243
  return _this2.seriesList[sId].isExistGrp && !_this2.seriesList[sId].isOverlapping;
54101
54244
  });
54102
54245
  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$ : [];
54103
- var labelPos;
54104
- var dataPos;
54246
+ var gp;
54247
+ var dp;
54105
54248
  var value;
54106
54249
  var labelStartPoint;
54107
54250
  var labelEndPoint;
@@ -54149,39 +54292,31 @@ var element_tip_modules = {
54149
54292
  }
54150
54293
 
54151
54294
  data.forEach(function (selectedData, i) {
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
- }
54295
+ if (labelTipOpt.fixedPosTop) {
54296
+ value = valueAxesRange.max;
54297
+ } else if (isExistGrp) {
54298
+ var sumValue = visibleSeries.reduce(function (ac, sId) {
54299
+ var _selectedData$sId$val, _selectedData$sId;
54300
+
54301
+ 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;
54302
+ }, 0);
54303
+ var nonGroupValues = visibleSeries.filter(function (sId) {
54304
+ return !groups.includes(sId);
54305
+ }).map(function (sId) {
54306
+ var _selectedData$sId$val2, _selectedData$sId2;
54307
+
54308
+ 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];
54309
+ });
54310
+ value = Math.max.apply(Math, _toConsumableArray(nonGroupValues).concat([sumValue]));
54311
+ } else if (visibleSeries.length) {
54312
+ var visibleValue = visibleSeries.map(function (sId) {
54313
+ var _selectedData$sId$val3, _selectedData$sId3;
54314
+
54315
+ 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];
54316
+ });
54317
+ value = Math.max.apply(Math, _toConsumableArray(visibleValue));
54318
+ } else {
54319
+ value = valueAxesRange.max;
54185
54320
  }
54186
54321
 
54187
54322
  if (labelAxes.labels) {
@@ -54191,17 +54326,18 @@ var element_tip_modules = {
54191
54326
 
54192
54327
  var labelIndex = dataIndex[i] - startIndex;
54193
54328
  var labelCenter = Math.round(labelStartPoint + labelGap * labelIndex);
54194
- labelPos = labelCenter + labelGap / 2;
54329
+ dp = labelCenter + labelGap / 2;
54195
54330
  } else {
54196
- labelPos = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
54331
+ dp = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
54197
54332
  }
54198
54333
 
54199
- dataPos = valuePositionCalcFunction(value, valueAxesSteps.graphMin, valueAxesSteps.graphMax, valueSpace, valueStartPoint) + offset;
54334
+ gp = valuePositionCalcFunction(value, valueAxesRange.min, valueAxesRange.max, valueSpace, valueStartPoint);
54335
+ gp += offset;
54200
54336
 
54201
54337
  _this2.showTip({
54202
54338
  context: _this2.bufferCtx,
54203
- x: isHorizontal ? dataPos : labelPos,
54204
- y: isHorizontal ? labelPos : dataPos,
54339
+ x: isHorizontal ? gp : dp,
54340
+ y: isHorizontal ? dp : gp,
54205
54341
  opt: labelTipOpt,
54206
54342
  isSamePos: false
54207
54343
  });
@@ -54313,11 +54449,10 @@ var element_tip_modules = {
54313
54449
  }
54314
54450
  } else if (isHorizontal) {
54315
54451
  gp = helpers_canvas.calculateX(value, graphX.graphMin, graphX.graphMax, xArea, xsp);
54316
- gp = value < 0 ? gp - offset : gp + offset;
54452
+ gp += offset;
54317
54453
  } else {
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;
54454
+ gp = helpers_canvas.calculateY(value, graphY.graphMin, graphY.graphMax, yArea, ysp);
54455
+ gp -= offset;
54321
54456
  }
54322
54457
 
54323
54458
  var maxTipType = 'center';
@@ -54349,8 +54484,7 @@ var element_tip_modules = {
54349
54484
  arrowSize: arrowSize,
54350
54485
  borderRadius: borderRadius,
54351
54486
  text: text,
54352
- textStyle: textStyle,
54353
- isNegative: value < 0
54487
+ textStyle: textStyle
54354
54488
  });
54355
54489
  }
54356
54490
 
@@ -54384,21 +54518,12 @@ var element_tip_modules = {
54384
54518
  borderRadius = param.borderRadius,
54385
54519
  text = param.text,
54386
54520
  opt = param.opt,
54387
- textStyle = param.textStyle,
54388
- isNegative = param.isNegative;
54521
+ textStyle = param.textStyle;
54389
54522
  var ctx = param.context;
54390
54523
  var sx = x - width / 2;
54391
54524
  var ex = x + width / 2;
54392
54525
  var sy = y - height;
54393
54526
  var ey = y;
54394
-
54395
- if (isNegative) {
54396
- if (isHorizontal) {
54397
- sx = x - width / 2 - width;
54398
- ex = x - width / 2;
54399
- }
54400
- }
54401
-
54402
54527
  ctx.save();
54403
54528
  ctx.font = textStyle;
54404
54529
  ctx.fillStyle = (_opt$tipBackground = opt.tipBackground) !== null && _opt$tipBackground !== void 0 ? _opt$tipBackground : opt.tipStyle.background;
@@ -54406,73 +54531,44 @@ var element_tip_modules = {
54406
54531
  ctx.beginPath();
54407
54532
  ctx.moveTo(sx + borderRadius, sy);
54408
54533
  ctx.quadraticCurveTo(sx, sy, sx, sy + borderRadius);
54534
+
54535
+ if (isHorizontal) {
54536
+ ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
54537
+ ctx.lineTo(sx - arrowSize, ey - height / 2);
54538
+ ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
54539
+ }
54540
+
54409
54541
  ctx.lineTo(sx, ey - borderRadius);
54410
54542
  ctx.quadraticCurveTo(sx, ey, sx + borderRadius, ey);
54543
+
54544
+ if (!isHorizontal) {
54545
+ if (type === 'left') {
54546
+ ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
54547
+ ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
54548
+ } else if (type === 'right') {
54549
+ ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
54550
+ ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
54551
+ } else {
54552
+ ctx.lineTo(x - arrowSize, ey);
54553
+ ctx.lineTo(x, ey + arrowSize);
54554
+ ctx.lineTo(x + arrowSize, ey);
54555
+ }
54556
+ }
54557
+
54411
54558
  ctx.lineTo(ex - borderRadius, ey);
54412
54559
  ctx.quadraticCurveTo(ex, ey, ex, ey - borderRadius);
54413
54560
  ctx.lineTo(ex, sy + borderRadius);
54414
54561
  ctx.quadraticCurveTo(ex, sy, ex - borderRadius, sy);
54415
54562
  ctx.lineTo(sx + borderRadius, sy);
54416
54563
  ctx.closePath();
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
-
54564
+ ctx.fill();
54469
54565
  ctx.restore();
54470
54566
  ctx.save();
54471
54567
  ctx.font = textStyle;
54472
54568
  ctx.fillStyle = (_opt$tipTextColor = opt.tipTextColor) !== null && _opt$tipTextColor !== void 0 ? _opt$tipTextColor : opt.tipStyle.textColor;
54473
54569
  ctx.textBaseline = 'middle';
54474
54570
  ctx.textAlign = 'center';
54475
- ctx.fillText("".concat(text), sx + width / 2, sy + height / 2);
54571
+ ctx.fillText("".concat(text), x, sy + height / 2);
54476
54572
  ctx.restore();
54477
54573
  },
54478
54574
 
@@ -54724,13 +54820,11 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54724
54820
  value: function drawSyncedIndicator(_ref) {
54725
54821
  var horizontal = _ref.horizontal,
54726
54822
  label = _ref.label,
54727
- mousePosition = _ref.mousePosition,
54728
- useAxisTrigger = _ref.useAxisTrigger;
54823
+ mousePosition = _ref.mousePosition;
54729
54824
  this.drawSyncedIndicator({
54730
54825
  horizontal: horizontal,
54731
54826
  label: label,
54732
- mousePosition: mousePosition,
54733
- useAxisTrigger: useAxisTrigger
54827
+ mousePosition: mousePosition
54734
54828
  });
54735
54829
  }
54736
54830
  }, {
@@ -56558,7 +56652,6 @@ var DEFAULT_OPTIONS = {
56558
56652
  combo: false,
56559
56653
  tooltip: {
56560
56654
  use: true,
56561
- trigger: 'axis',
56562
56655
  sortByValue: true,
56563
56656
  backgroundColor: '#4C4C4C',
56564
56657
  fontColor: '#FFFFFF',