apexcharts 7.2.0 → 7.4.0

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.
Files changed (172) hide show
  1. package/LICENSE +30 -11
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +545 -463
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.esm.js +1149 -801
  6. package/dist/apexcharts.js +684 -254
  7. package/dist/apexcharts.min.js +2 -2
  8. package/dist/apexcharts.ssr.common.js +2 -2
  9. package/dist/apexcharts.ssr.esm.js +684 -254
  10. package/dist/area.common.js +1 -1
  11. package/dist/area.esm.js +1 -1
  12. package/dist/bar.common.js +2 -2
  13. package/dist/bar.esm.js +20 -10
  14. package/dist/bar.js +2 -2
  15. package/dist/boxPlot.common.js +2 -2
  16. package/dist/boxPlot.esm.js +20 -10
  17. package/dist/bubble.common.js +1 -1
  18. package/dist/bubble.esm.js +1 -1
  19. package/dist/candlestick.common.js +2 -2
  20. package/dist/candlestick.esm.js +20 -10
  21. package/dist/candlestick.js +2 -2
  22. package/dist/column.common.js +2 -2
  23. package/dist/column.esm.js +20 -10
  24. package/dist/core.common.js +2 -2
  25. package/dist/core.esm.js +545 -463
  26. package/dist/donut.common.js +1 -1
  27. package/dist/donut.esm.js +1 -1
  28. package/dist/dumbbell.common.js +2 -2
  29. package/dist/dumbbell.esm.js +20 -10
  30. package/dist/features/all.common.js +2 -2
  31. package/dist/features/all.esm.js +364 -26
  32. package/dist/features/annotations.common.js +1 -1
  33. package/dist/features/annotations.esm.js +1 -1
  34. package/dist/features/annotations.js +1 -1
  35. package/dist/features/context-menu.common.js +1 -1
  36. package/dist/features/context-menu.esm.js +1 -1
  37. package/dist/features/context-menu.js +1 -1
  38. package/dist/features/drilldown.common.js +1 -1
  39. package/dist/features/drilldown.esm.js +1 -1
  40. package/dist/features/drilldown.js +1 -1
  41. package/dist/features/dumbbell.common.js +1 -1
  42. package/dist/features/dumbbell.esm.js +1 -1
  43. package/dist/features/dumbbell.js +1 -1
  44. package/dist/features/exports.common.js +2 -2
  45. package/dist/features/exports.esm.js +12 -14
  46. package/dist/features/exports.js +2 -2
  47. package/dist/features/facet.common.js +1 -1
  48. package/dist/features/facet.esm.js +1 -1
  49. package/dist/features/facet.js +1 -1
  50. package/dist/features/history.common.js +1 -1
  51. package/dist/features/history.esm.js +1 -1
  52. package/dist/features/history.js +1 -1
  53. package/dist/features/ink.common.js +1 -1
  54. package/dist/features/ink.esm.js +1 -1
  55. package/dist/features/ink.js +1 -1
  56. package/dist/features/keyboard.common.js +2 -2
  57. package/dist/features/keyboard.esm.js +14 -1
  58. package/dist/features/keyboard.js +2 -2
  59. package/dist/features/legend.common.js +1 -1
  60. package/dist/features/legend.esm.js +1 -1
  61. package/dist/features/legend.js +1 -1
  62. package/dist/features/link.common.js +1 -1
  63. package/dist/features/link.esm.js +38 -38
  64. package/dist/features/link.js +1 -1
  65. package/dist/features/marks.common.js +1 -1
  66. package/dist/features/marks.esm.js +1 -1
  67. package/dist/features/marks.js +1 -1
  68. package/dist/features/measure.common.js +1 -1
  69. package/dist/features/measure.esm.js +1 -1
  70. package/dist/features/measure.js +1 -1
  71. package/dist/features/morph.common.js +1 -1
  72. package/dist/features/morph.esm.js +1 -1
  73. package/dist/features/morph.js +1 -1
  74. package/dist/features/perspectives.common.js +1 -1
  75. package/dist/features/perspectives.esm.js +11 -11
  76. package/dist/features/perspectives.js +1 -1
  77. package/dist/features/raincloud.common.js +1 -1
  78. package/dist/features/raincloud.esm.js +1 -1
  79. package/dist/features/raincloud.js +1 -1
  80. package/dist/features/renderer-canvas.common.js +1 -1
  81. package/dist/features/renderer-canvas.esm.js +1 -1
  82. package/dist/features/renderer-canvas.js +1 -1
  83. package/dist/features/stats.common.js +1 -1
  84. package/dist/features/stats.esm.js +1 -1
  85. package/dist/features/stats.js +1 -1
  86. package/dist/features/storyboard.common.js +1 -1
  87. package/dist/features/storyboard.esm.js +11 -11
  88. package/dist/features/storyboard.js +1 -1
  89. package/dist/features/streamgraph.common.js +1 -1
  90. package/dist/features/streamgraph.esm.js +1 -1
  91. package/dist/features/streamgraph.js +1 -1
  92. package/dist/features/toolbar.common.js +2 -2
  93. package/dist/features/toolbar.esm.js +172 -25
  94. package/dist/features/toolbar.js +2 -2
  95. package/dist/features/trellis.common.js +1 -1
  96. package/dist/features/trellis.esm.js +1 -1
  97. package/dist/features/trellis.js +1 -1
  98. package/dist/features/waterfall.common.js +1 -1
  99. package/dist/features/waterfall.esm.js +1 -1
  100. package/dist/features/waterfall.js +1 -1
  101. package/dist/features/weave.common.js +2 -2
  102. package/dist/features/weave.esm.js +180 -2
  103. package/dist/features/weave.js +2 -2
  104. package/dist/heatmap.common.js +1 -1
  105. package/dist/heatmap.esm.js +1 -1
  106. package/dist/heatmap.js +1 -1
  107. package/dist/histogram.common.js +2 -2
  108. package/dist/histogram.esm.js +20 -10
  109. package/dist/line.common.js +1 -1
  110. package/dist/line.esm.js +1 -1
  111. package/dist/line.js +1 -1
  112. package/dist/pictograms.common.js +1 -1
  113. package/dist/pictograms.esm.js +1 -1
  114. package/dist/pictograms.js +1 -1
  115. package/dist/pie.common.js +1 -1
  116. package/dist/pie.esm.js +1 -1
  117. package/dist/pie.js +1 -1
  118. package/dist/polarArea.common.js +1 -1
  119. package/dist/polarArea.esm.js +1 -1
  120. package/dist/radar.common.js +1 -1
  121. package/dist/radar.esm.js +1 -1
  122. package/dist/radar.js +1 -1
  123. package/dist/radialBar.common.js +1 -1
  124. package/dist/radialBar.esm.js +1 -1
  125. package/dist/radialBar.js +1 -1
  126. package/dist/raincloud.common.js +2 -2
  127. package/dist/raincloud.esm.js +20 -10
  128. package/dist/rangeArea.common.js +1 -1
  129. package/dist/rangeArea.esm.js +1 -1
  130. package/dist/rangeBar.common.js +2 -2
  131. package/dist/rangeBar.esm.js +20 -10
  132. package/dist/scatter.common.js +1 -1
  133. package/dist/scatter.esm.js +1 -1
  134. package/dist/streamgraph.common.js +1 -1
  135. package/dist/streamgraph.esm.js +1 -1
  136. package/dist/sunburst.common.js +1 -1
  137. package/dist/sunburst.esm.js +1 -1
  138. package/dist/sunburst.js +1 -1
  139. package/dist/treemap.common.js +1 -1
  140. package/dist/treemap.esm.js +1 -1
  141. package/dist/treemap.js +1 -1
  142. package/dist/unit-shapes.common.js +1 -1
  143. package/dist/unit-shapes.esm.js +1 -1
  144. package/dist/unit-shapes.js +1 -1
  145. package/dist/unit.common.js +1 -1
  146. package/dist/unit.esm.js +79 -79
  147. package/dist/unit.js +1 -1
  148. package/dist/violin.common.js +2 -2
  149. package/dist/violin.esm.js +20 -10
  150. package/dist/violin.js +2 -2
  151. package/dist/waterfall.common.js +2 -2
  152. package/dist/waterfall.esm.js +20 -10
  153. package/package.json +2 -2
  154. package/src/apexcharts.js +39 -15
  155. package/src/charts/common/bar/Helpers.js +31 -12
  156. package/src/modules/Data.js +8 -2
  157. package/src/modules/Exports.js +14 -12
  158. package/src/modules/Formatters.js +24 -1
  159. package/src/modules/Range.js +28 -1
  160. package/src/modules/Toolbar.js +112 -2
  161. package/src/modules/ZoomPanSelection.js +85 -7
  162. package/src/modules/accessibility/KeyboardNavigation.js +14 -0
  163. package/src/modules/axes/YAxis.js +12 -15
  164. package/src/modules/helpers/UpdateHelpers.js +25 -8
  165. package/src/modules/settings/Globals.js +5 -10
  166. package/src/modules/settings/Options.js +15 -0
  167. package/src/modules/weave/PluginAPI.js +57 -1
  168. package/src/modules/weave/WeaveHost.js +148 -0
  169. package/src/ssr/DOMShim.js +50 -0
  170. package/src/types/internal.d.ts +1 -1
  171. package/src/utils/Utils.js +6 -9
  172. package/types/apexcharts.d.ts +17 -0
package/dist/core.esm.js CHANGED
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  });
40
40
  };
41
41
  /*!
42
- * ApexCharts v7.2.0
42
+ * ApexCharts v7.4.0
43
43
  * (c) 2018-2026 ApexCharts
44
44
  */
45
45
  class Environment {
@@ -78,6 +78,11 @@ class Environment {
78
78
  return {};
79
79
  }
80
80
  }
81
+ const CHAR_WIDTH_EM = 0.55;
82
+ const ASCENT_EM = 0.917;
83
+ const DESCENT_EM = 0.25;
84
+ const LINE_HEIGHT_EM = 1.1;
85
+ const DEFAULT_FONT_SIZE = 11;
81
86
  class SSRElement {
82
87
  /**
83
88
  * @param {string} nodeName
@@ -198,6 +203,43 @@ class SSRElement {
198
203
  y: 0
199
204
  };
200
205
  }
206
+ getBBox() {
207
+ if (this.nodeName !== "text" && this.nodeName !== "tspan") {
208
+ return { x: 0, y: 0, width: 0, height: 0 };
209
+ }
210
+ const lines = this._textLines();
211
+ const longest = lines.reduce((acc, line) => Math.max(acc, line.length), 0);
212
+ if (!longest) {
213
+ return { x: 0, y: 0, width: 0, height: 0 };
214
+ }
215
+ const fontSize = parseFloat(this.attributes.get("font-size")) || DEFAULT_FONT_SIZE;
216
+ const width = longest * fontSize * CHAR_WIDTH_EM;
217
+ const height = fontSize * (ASCENT_EM + DESCENT_EM) + (lines.length - 1) * fontSize * LINE_HEIGHT_EM;
218
+ const anchor = this.attributes.get("text-anchor");
219
+ const x = parseFloat(this.attributes.get("x")) || 0;
220
+ const y = parseFloat(this.attributes.get("y")) || 0;
221
+ return {
222
+ x: anchor === "middle" ? x - width / 2 : anchor === "end" ? x - width : x,
223
+ y: y - fontSize * ASCENT_EM,
224
+ width,
225
+ height
226
+ };
227
+ }
228
+ /**
229
+ * Text of this element, one entry per rendered line
230
+ * @returns {string[]}
231
+ */
232
+ _textLines() {
233
+ var _a;
234
+ const tspans = this.children.filter((child) => child.nodeName === "tspan");
235
+ if (tspans.length) {
236
+ return tspans.map((tspan) => {
237
+ var _a2;
238
+ return String((_a2 = tspan.textContent) != null ? _a2 : "");
239
+ });
240
+ }
241
+ return [String((_a = this.textContent) != null ? _a : "")];
242
+ }
201
243
  getRootNode() {
202
244
  let root = this;
203
245
  while (root.parentNode) {
@@ -687,15 +729,12 @@ let Utils$1 = class Utils {
687
729
  return output;
688
730
  }
689
731
  // A per-series shallow copy: the series OBJECTS are copied, their data arrays
690
- // are shared. Almost every internal "mutation" of a series' data is a
691
- // property REPLACEMENT (`series[i].data = []` on legend collapse,
692
- // `series[i] = 0` for non-axis charts), and those cannot reach a copy made
693
- // this way because the series object was copied at capture time. The
694
- // exception is appendData(), whose push loop grows the shared data array in
695
- // place, so a copy taken before it does see the appended points; see the
696
- // note above defineLazyInitialSeries(). This is the same cheap shape
697
- // `globals.initialSeries` captures, so snapshotting a config stays O(n)
698
- // instead of deep-cloning every point.
732
+ // are shared. Every internal "mutation" of a series' data is a property
733
+ // REPLACEMENT (`series[i].data = []` on legend collapse, `series[i] = 0` for
734
+ // non-axis charts, appendData's concat), and those cannot reach a copy made
735
+ // this way because the series object was copied at capture time. This is the
736
+ // same cheap shape `globals.initialSeries` captures, so snapshotting a config
737
+ // stays O(n) instead of deep-cloning every point.
699
738
  /**
700
739
  * @param {any} series
701
740
  */
@@ -1351,11 +1390,11 @@ class DateTime {
1351
1390
  format = format.replace(/(^|[^\\])yyyy+/g, "$1" + y);
1352
1391
  format = format.replace(/(^|[^\\])yy/g, "$1" + y.toString().substr(2, 2));
1353
1392
  format = format.replace(/(^|[^\\])y/g, "$1" + y);
1354
- const M2 = (utc ? date.getUTCMonth() : date.getMonth()) + 1;
1393
+ const M = (utc ? date.getUTCMonth() : date.getMonth()) + 1;
1355
1394
  format = format.replace(/(^|[^\\])MMMM+/g, "$1" + MMMM[0]);
1356
1395
  format = format.replace(/(^|[^\\])MMM/g, "$1" + MMM[0]);
1357
- format = format.replace(/(^|[^\\])MM/g, "$1" + ii(M2));
1358
- format = format.replace(/(^|[^\\])M/g, "$1" + M2);
1396
+ format = format.replace(/(^|[^\\])MM/g, "$1" + ii(M));
1397
+ format = format.replace(/(^|[^\\])M/g, "$1" + M);
1359
1398
  const d = utc ? date.getUTCDate() : date.getDate();
1360
1399
  format = format.replace(/(^|[^\\])dddd+/g, "$1" + dddd[0]);
1361
1400
  format = format.replace(/(^|[^\\])ddd/g, "$1" + ddd[0]);
@@ -1397,8 +1436,8 @@ class DateTime {
1397
1436
  const day = (utc ? date.getUTCDay() : date.getDay()) + 1;
1398
1437
  format = format.replace(new RegExp(dddd[0], "g"), dddd[day]);
1399
1438
  format = format.replace(new RegExp(ddd[0], "g"), ddd[day]);
1400
- format = format.replace(new RegExp(MMMM[0], "g"), MMMM[M2]);
1401
- format = format.replace(new RegExp(MMM[0], "g"), MMM[M2]);
1439
+ format = format.replace(new RegExp(MMMM[0], "g"), MMMM[M]);
1440
+ format = format.replace(new RegExp(MMM[0], "g"), MMM[M]);
1402
1441
  format = format.replace(/\\(.)/g, "$1");
1403
1442
  return format;
1404
1443
  }
@@ -1866,6 +1905,7 @@ class Formatters {
1866
1905
  setLabelFormatters() {
1867
1906
  const w = this.w;
1868
1907
  const fmt = w.formatters;
1908
+ const inferredNumericX = w.axisFlags.isXNumeric && w.axisFlags.dataFormatXNumeric && w.config.xaxis.type !== "datetime" && !w.config.xaxis.convertedCatToNumeric && !w.globals.isBarHorizontal;
1869
1909
  fmt.xaxisTooltipFormatter = (val) => {
1870
1910
  return this.defaultGeneralFormatter(val);
1871
1911
  };
@@ -1882,8 +1922,13 @@ class Formatters {
1882
1922
  fmt.xLabelFormatter = w.config.xaxis.labels.formatter;
1883
1923
  } else {
1884
1924
  fmt.xLabelFormatter = (val) => {
1925
+ var _a;
1885
1926
  if (Utils$1.isNumber(val)) {
1886
- if (!w.config.xaxis.convertedCatToNumeric && w.config.xaxis.type === "numeric") {
1927
+ if (!w.config.xaxis.convertedCatToNumeric && (w.config.xaxis.type === "numeric" || inferredNumericX)) {
1928
+ const ticks = (_a = w.globals.xAxisScale) == null ? void 0 : _a.result;
1929
+ if (inferredNumericX && Array.isArray(ticks) && ticks.every(Number.isInteger)) {
1930
+ return val.toFixed(0);
1931
+ }
1887
1932
  if (Utils$1.isNumber(w.config.xaxis.decimalsInFloat)) {
1888
1933
  return val.toFixed(w.config.xaxis.decimalsInFloat);
1889
1934
  } else {
@@ -1909,6 +1954,12 @@ class Formatters {
1909
1954
  }
1910
1955
  if (typeof w.config.tooltip.x.formatter === "function") {
1911
1956
  fmt.ttKeyFormatter = w.config.tooltip.x.formatter;
1957
+ } else if (w.config.xaxis.labels.formatter === void 0 && inferredNumericX) {
1958
+ const xLabelFormatter = (
1959
+ /** @type {(val: any) => any} */
1960
+ fmt.xLabelFormatter
1961
+ );
1962
+ fmt.ttKeyFormatter = (val) => Number.isInteger(val) ? val.toFixed(0) : xLabelFormatter(val);
1912
1963
  } else {
1913
1964
  fmt.ttKeyFormatter = fmt.xLabelFormatter;
1914
1965
  }
@@ -2767,6 +2818,17 @@ class Options {
2767
2818
  // around the pinch centroid (matching the x-only wheel/toolbar zoom),
2768
2819
  // frame-by-frame rather than the 400ms wheel throttle.
2769
2820
  pinch: "auto",
2821
+ // Drag-to-zoom is deliberate, so it is not gated the way those two
2822
+ // are: it stays on with the toolbar hidden. The reset button that
2823
+ // undoes it does not, which leaves the viewer in a window with no
2824
+ // exit. So while the chart IS zoomed and nothing else on screen can
2825
+ // reset it, one reset control is drawn where the toolbar would have
2826
+ // been, and it goes when the range does. A chart nobody zooms is
2827
+ // untouched. Set false for a page that supplies its own reset (which
2828
+ // also turns off the Escape shortcut), or true to force the control
2829
+ // on whenever the chart is zoomed, even where `toolbar.tools.reset`
2830
+ // is off.
2831
+ resetControl: "auto",
2770
2832
  zoomedArea: {
2771
2833
  fill: {
2772
2834
  color: "#90CAF9",
@@ -2833,6 +2895,11 @@ class Options {
2833
2895
  borderRadius: 0,
2834
2896
  borderRadiusApplication: "around",
2835
2897
  // [around, end]
2898
+ // Which segments of a stack round. 'all' caps both ends of the
2899
+ // stack (baseline and far end); 'last' caps only the far end, so
2900
+ // the stack sits square on the baseline. Stacked charts only.
2901
+ borderRadiusWhenStacked: "all",
2902
+ // [all, last]
2836
2903
  rangeBarOverlap: true,
2837
2904
  rangeBarGroupRows: false,
2838
2905
  hideZeroBarsWhenGrouped: false,
@@ -7621,16 +7688,11 @@ class Globals {
7621
7688
  * which cannot reach the captured copies because each series object was
7622
7689
  * copied at capture time.
7623
7690
  *
7624
- * The one in-place mutator is appendData(), whose push loop grows the shared
7625
- * data array. Re-capturing after it does not undo that: the pushed points
7626
- * are already in the array both snapshots point at, so a snapshot taken
7627
- * before the append reads back as appended. That is the documented
7628
- * behaviour of appendData(overwriteInitialSeries = true), and the `false`
7629
- * case is not honoured for a separate, older reason: Data.parseData()
7630
- * re-captures initialSeries unconditionally on the re-render appendData
7631
- * triggers. Detaching would mean copying the data arrays, which is exactly
7632
- * the per-point cost this snapshot exists to avoid. The same exception
7633
- * applies to `initialConfig.series`, which is captured with the same shape.
7691
+ * appendData() used to be the exception, growing the shared data array in
7692
+ * place. It now replaces the array instead (`data = data.concat(newData)`):
7693
+ * one array copy per call, against the per-point cost this snapshot exists
7694
+ * to avoid. With that, no internal edit can reach a captured copy. The same
7695
+ * holds for `initialConfig.series`, which is captured with the same shape.
7634
7696
  *
7635
7697
  * @param {Record<string, any>} globals
7636
7698
  */
@@ -8157,9 +8219,9 @@ class CoreUtils {
8157
8219
  if (w.seriesData.series.length === 0) return total;
8158
8220
  for (let i2 = 0; i2 < w.seriesData.series[w.globals.maxValsInArrayIndex].length; i2++) {
8159
8221
  let t2 = 0;
8160
- for (let j = 0; j < w.seriesData.series.length; j++) {
8161
- if (typeof w.seriesData.series[j][i2] !== "undefined" && excludedSeriesIndices.indexOf(j) === -1) {
8162
- t2 += w.seriesData.series[j][i2];
8222
+ for (let j2 = 0; j2 < w.seriesData.series.length; j2++) {
8223
+ if (typeof w.seriesData.series[j2][i2] !== "undefined" && excludedSeriesIndices.indexOf(j2) === -1) {
8224
+ t2 += w.seriesData.series[j2][i2];
8163
8225
  }
8164
8226
  }
8165
8227
  total.push(t2);
@@ -8405,8 +8467,8 @@ class CoreUtils {
8405
8467
  w.globals.seriesTotals = w.seriesData.series.map((ser) => {
8406
8468
  let total = 0;
8407
8469
  if (Array.isArray(ser)) {
8408
- for (let j = 0; j < ser.length; j++) {
8409
- total += ser[j];
8470
+ for (let j2 = 0; j2 < ser.length; j2++) {
8471
+ total += ser[j2];
8410
8472
  }
8411
8473
  } else {
8412
8474
  total += ser;
@@ -8422,9 +8484,9 @@ class CoreUtils {
8422
8484
  const w = this.w;
8423
8485
  const seriesTotalsXRange = w.seriesData.series.map((ser, index) => {
8424
8486
  let total = 0;
8425
- for (let j = 0; j < ser.length; j++) {
8426
- if (w.seriesData.seriesX[index][j] > minX && w.seriesData.seriesX[index][j] < maxX) {
8427
- total += ser[j];
8487
+ for (let j2 = 0; j2 < ser.length; j2++) {
8488
+ if (w.seriesData.seriesX[index][j2] > minX && w.seriesData.seriesX[index][j2] < maxX) {
8489
+ total += ser[j2];
8428
8490
  }
8429
8491
  }
8430
8492
  return total;
@@ -8442,11 +8504,11 @@ class CoreUtils {
8442
8504
  w.globals.seriesPercent = w.seriesData.series.map((ser) => {
8443
8505
  const seriesPercent = [];
8444
8506
  if (Array.isArray(ser)) {
8445
- for (let j = 0; j < ser.length; j++) {
8446
- const total = w.seriesData.stackedSeriesTotals[j];
8507
+ for (let j2 = 0; j2 < ser.length; j2++) {
8508
+ const total = w.seriesData.stackedSeriesTotals[j2];
8447
8509
  let percent = 0;
8448
8510
  if (total) {
8449
- percent = 100 * ser[j] / total;
8511
+ percent = 100 * ser[j2] / total;
8450
8512
  }
8451
8513
  seriesPercent.push(percent);
8452
8514
  }
@@ -8821,44 +8883,44 @@ function parsePath(d) {
8821
8883
  if (cmd === "Z") {
8822
8884
  commands.push(["Z"]);
8823
8885
  } else if (cmd === "M" || cmd === "L" || cmd === "T") {
8824
- for (let j = 0; j < nums.length; j += 2) {
8825
- commands.push([cmd, nums[j], nums[j + 1]]);
8886
+ for (let j2 = 0; j2 < nums.length; j2 += 2) {
8887
+ commands.push([cmd, nums[j2], nums[j2 + 1]]);
8826
8888
  }
8827
8889
  } else if (cmd === "H") {
8828
- for (let j = 0; j < nums.length; j++) {
8829
- commands.push([cmd, nums[j]]);
8890
+ for (let j2 = 0; j2 < nums.length; j2++) {
8891
+ commands.push([cmd, nums[j2]]);
8830
8892
  }
8831
8893
  } else if (cmd === "V") {
8832
- for (let j = 0; j < nums.length; j++) {
8833
- commands.push([cmd, nums[j]]);
8894
+ for (let j2 = 0; j2 < nums.length; j2++) {
8895
+ commands.push([cmd, nums[j2]]);
8834
8896
  }
8835
8897
  } else if (cmd === "C") {
8836
- for (let j = 0; j < nums.length; j += 6) {
8898
+ for (let j2 = 0; j2 < nums.length; j2 += 6) {
8837
8899
  commands.push([
8838
8900
  cmd,
8839
- nums[j],
8840
- nums[j + 1],
8841
- nums[j + 2],
8842
- nums[j + 3],
8843
- nums[j + 4],
8844
- nums[j + 5]
8901
+ nums[j2],
8902
+ nums[j2 + 1],
8903
+ nums[j2 + 2],
8904
+ nums[j2 + 3],
8905
+ nums[j2 + 4],
8906
+ nums[j2 + 5]
8845
8907
  ]);
8846
8908
  }
8847
8909
  } else if (cmd === "S" || cmd === "Q") {
8848
- for (let j = 0; j < nums.length; j += 4) {
8849
- commands.push([cmd, nums[j], nums[j + 1], nums[j + 2], nums[j + 3]]);
8910
+ for (let j2 = 0; j2 < nums.length; j2 += 4) {
8911
+ commands.push([cmd, nums[j2], nums[j2 + 1], nums[j2 + 2], nums[j2 + 3]]);
8850
8912
  }
8851
8913
  } else if (cmd === "A") {
8852
- for (let j = 0; j < nums.length; j += 7) {
8914
+ for (let j2 = 0; j2 < nums.length; j2 += 7) {
8853
8915
  commands.push([
8854
8916
  cmd,
8855
- nums[j],
8856
- nums[j + 1],
8857
- nums[j + 2],
8858
- nums[j + 3],
8859
- nums[j + 4],
8860
- nums[j + 5],
8861
- nums[j + 6]
8917
+ nums[j2],
8918
+ nums[j2 + 1],
8919
+ nums[j2 + 2],
8920
+ nums[j2 + 3],
8921
+ nums[j2 + 4],
8922
+ nums[j2 + 5],
8923
+ nums[j2 + 6]
8862
8924
  ]);
8863
8925
  }
8864
8926
  }
@@ -8978,11 +9040,11 @@ function findNextM(arr, offset) {
8978
9040
  return false;
8979
9041
  }
8980
9042
  function arcToBezier(pos, val) {
8981
- var rx = Math.abs(val[1]), ry = Math.abs(val[2]), xAxisRotation = val[3] % 360, largeArcFlag = val[4], sweepFlag = val[5], x = val[6], y = val[7], A2 = new Point(pos[0], pos[1]), B = new Point(x, y), primedCoord, lambda, mat, k, c, cSquare, t2, O, OA, OB, tetaStart, tetaEnd, deltaTeta, nbSectors, f, arcSegPoints, angle, sinAngle, cosAngle, pt, i2, il, retVal = [], x1, y1, x2, y2;
8982
- if (rx === 0 || ry === 0 || A2.x === B.x && A2.y === B.y) {
8983
- return [["C", A2.x, A2.y, B.x, B.y, B.x, B.y]];
9043
+ var rx = Math.abs(val[1]), ry = Math.abs(val[2]), xAxisRotation = val[3] % 360, largeArcFlag = val[4], sweepFlag = val[5], x = val[6], y = val[7], A = new Point(pos[0], pos[1]), B = new Point(x, y), primedCoord, lambda, mat, k, c, cSquare, t2, O, OA, OB, tetaStart, tetaEnd, deltaTeta, nbSectors, f, arcSegPoints, angle, sinAngle, cosAngle, pt, i2, il, retVal = [], x1, y1, x2, y2;
9044
+ if (rx === 0 || ry === 0 || A.x === B.x && A.y === B.y) {
9045
+ return [["C", A.x, A.y, B.x, B.y, B.x, B.y]];
8984
9046
  }
8985
- primedCoord = new Point((A2.x - B.x) / 2, (A2.y - B.y) / 2).transform(
9047
+ primedCoord = new Point((A.x - B.x) / 2, (A.y - B.y) / 2).transform(
8986
9048
  // Start with the identity matrix (no args → Matrix defaults a=d=1, others 0).
8987
9049
  // Passing all-zero args here would produce a degenerate zero matrix, since
8988
9050
  // `0 ?? 1` is `0`, not `1` — every subsequent transform then yields (0,0)
@@ -8998,9 +9060,9 @@ function arcToBezier(pos, val) {
8998
9060
  }
8999
9061
  mat = /** @type {any} */
9000
9062
  new Matrix().rotate(xAxisRotation).scale(1 / rx, 1 / ry).rotate(-xAxisRotation);
9001
- A2 = A2.transform(mat);
9063
+ A = A.transform(mat);
9002
9064
  B = B.transform(mat);
9003
- k = [B.x - A2.x, B.y - A2.y];
9065
+ k = [B.x - A.x, B.y - A.y];
9004
9066
  cSquare = k[0] * k[0] + k[1] * k[1];
9005
9067
  c = Math.sqrt(cSquare);
9006
9068
  k[0] /= c;
@@ -9009,8 +9071,8 @@ function arcToBezier(pos, val) {
9009
9071
  if (largeArcFlag === sweepFlag) {
9010
9072
  t2 *= -1;
9011
9073
  }
9012
- O = new Point((B.x + A2.x) / 2 + t2 * -k[1], (B.y + A2.y) / 2 + t2 * k[0]);
9013
- OA = new Point(A2.x - O.x, A2.y - O.y);
9074
+ O = new Point((B.x + A.x) / 2 + t2 * -k[1], (B.y + A.y) / 2 + t2 * k[0]);
9075
+ OA = new Point(A.x - O.x, A.y - O.y);
9014
9076
  OB = new Point(B.x - O.x, B.y - O.y);
9015
9077
  tetaStart = Math.acos(OA.x / Math.sqrt(OA.x * OA.x + OA.y * OA.y));
9016
9078
  if (OA.y < 0) tetaStart *= -1;
@@ -9800,7 +9862,7 @@ class Animations {
9800
9862
  const {
9801
9863
  el,
9802
9864
  realIndex,
9803
- j,
9865
+ j: j2,
9804
9866
  fill,
9805
9867
  pathFrom,
9806
9868
  pathTo,
@@ -9821,7 +9883,7 @@ class Animations {
9821
9883
  me.morphSVG(
9822
9884
  el,
9823
9885
  realIndex,
9824
- j,
9886
+ j2,
9825
9887
  w.config.chart.type === "line" && !w.globals.comboCharts ? "stroke" : fill,
9826
9888
  pathFrom,
9827
9889
  pathTo,
@@ -9897,7 +9959,7 @@ class Animations {
9897
9959
  * @param {any} el - SVG.js path element
9898
9960
  * @param {{realIndex: number, j?: number, isFill: boolean, isLast: boolean, speed: number, delay: number, mask?: {type: 'rect'|'radial', cx?: number, cy?: number, r?: number}}} params
9899
9961
  */
9900
- animateDraw(el, { realIndex, j, isFill, isLast, speed, delay, mask: maskShape }) {
9962
+ animateDraw(el, { realIndex, j: j2, isFill, isLast, speed, delay, mask: maskShape }) {
9901
9963
  const w = this.w;
9902
9964
  const me = this;
9903
9965
  const finalize = () => {
@@ -9918,7 +9980,7 @@ class Animations {
9918
9980
  const radialCx = maskShape && maskShape.cx || 0;
9919
9981
  const radialCy = maskShape && maskShape.cy || 0;
9920
9982
  const targetRadius = (maskShape && maskShape.r || w.layout.gridWidth / 2) + pad;
9921
- const maskId = `apexDrawMask${w.globals.cuid}-${realIndex}-${j != null ? j : 0}-${isFill ? "f" : "s"}`;
9983
+ const maskId = `apexDrawMask${w.globals.cuid}-${realIndex}-${j2 != null ? j2 : 0}-${isFill ? "f" : "s"}`;
9922
9984
  const mask = BrowserAPIs.createElementNS(SVGNS, "mask");
9923
9985
  mask.setAttribute("id", maskId);
9924
9986
  mask.setAttribute("maskUnits", "userSpaceOnUse");
@@ -10030,7 +10092,7 @@ class Animations {
10030
10092
  * pathTo (extra anchors sitting exactly on the final geometry) and snap to
10031
10093
  * the clean pathTo at the end.
10032
10094
  */
10033
- morphSVG(el, realIndex, j, fill, pathFrom, pathTo, speed, delay, scrollMorph, pathToInterp) {
10095
+ morphSVG(el, realIndex, j2, fill, pathFrom, pathTo, speed, delay, scrollMorph, pathToInterp) {
10034
10096
  var _a, _b;
10035
10097
  const w = this.w;
10036
10098
  if (!pathFrom) {
@@ -10078,9 +10140,9 @@ class Animations {
10078
10140
  morphAlgo,
10079
10141
  pathToInterp ? pathTo : void 0
10080
10142
  ).after(() => {
10081
- if (Utils$1.isNumber(j)) {
10143
+ if (Utils$1.isNumber(j2)) {
10082
10144
  const maxSeries = w.seriesData.series[w.globals.maxValsInArrayIndex];
10083
- if (maxSeries && j === maxSeries.length - 2 && w.globals.shouldAnimate) {
10145
+ if (maxSeries && j2 === maxSeries.length - 2 && w.globals.shouldAnimate) {
10084
10146
  this.animationCompleted(el);
10085
10147
  }
10086
10148
  } else if (fill !== "none" && w.globals.shouldAnimate) {
@@ -10653,7 +10715,7 @@ class Graphics {
10653
10715
  * @return {any} svg.js path object
10654
10716
  **/
10655
10717
  renderPaths({
10656
- j,
10718
+ j: j2,
10657
10719
  realIndex,
10658
10720
  pathFrom,
10659
10721
  pathTo,
@@ -10748,7 +10810,7 @@ class Graphics {
10748
10810
  });
10749
10811
  const defaultAnimateOpts = {
10750
10812
  el,
10751
- j,
10813
+ j: j2,
10752
10814
  realIndex,
10753
10815
  pathFrom,
10754
10816
  pathTo,
@@ -10766,7 +10828,7 @@ class Graphics {
10766
10828
  const isLast = w.globals.comboCharts ? true : realIndex === seriesCount - 1;
10767
10829
  anim.animateDraw(el, {
10768
10830
  realIndex,
10769
- j,
10831
+ j: j2,
10770
10832
  isFill,
10771
10833
  isLast,
10772
10834
  speed: drawSpeed,
@@ -11134,19 +11196,19 @@ class Graphics {
11134
11196
  const w = this.w;
11135
11197
  const filters = new Filters(this.w);
11136
11198
  const i2 = parseInt((_a = path.node.getAttribute("index")) != null ? _a : "", 10);
11137
- const j = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11138
- if (isNaN(i2) || isNaN(j)) return;
11199
+ const j2 = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11200
+ if (isNaN(i2) || isNaN(j2)) return;
11139
11201
  if (typeof w.config.chart.events.dataPointMouseEnter === "function") {
11140
11202
  w.config.chart.events.dataPointMouseEnter(e2, this.ctx, {
11141
11203
  seriesIndex: i2,
11142
- dataPointIndex: j,
11204
+ dataPointIndex: j2,
11143
11205
  w
11144
11206
  });
11145
11207
  }
11146
11208
  Graphics._fireEvent(w, "dataPointMouseEnter", [
11147
11209
  e2,
11148
11210
  this.ctx,
11149
- { seriesIndex: i2, dataPointIndex: j, w }
11211
+ { seriesIndex: i2, dataPointIndex: j2, w }
11150
11212
  ]);
11151
11213
  if (w.config.states.active.filter.type !== "none") {
11152
11214
  if (path.node.getAttribute("selected") === "true") {
@@ -11170,19 +11232,19 @@ class Graphics {
11170
11232
  const w = this.w;
11171
11233
  const filters = new Filters(this.w);
11172
11234
  const i2 = parseInt((_a = path.node.getAttribute("index")) != null ? _a : "", 10);
11173
- const j = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11174
- if (isNaN(i2) || isNaN(j)) return;
11235
+ const j2 = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11236
+ if (isNaN(i2) || isNaN(j2)) return;
11175
11237
  if (typeof w.config.chart.events.dataPointMouseLeave === "function") {
11176
11238
  w.config.chart.events.dataPointMouseLeave(e2, this.ctx, {
11177
11239
  seriesIndex: i2,
11178
- dataPointIndex: j,
11240
+ dataPointIndex: j2,
11179
11241
  w
11180
11242
  });
11181
11243
  }
11182
11244
  Graphics._fireEvent(w, "dataPointMouseLeave", [
11183
11245
  e2,
11184
11246
  this.ctx,
11185
- { seriesIndex: i2, dataPointIndex: j, w }
11247
+ { seriesIndex: i2, dataPointIndex: j2, w }
11186
11248
  ]);
11187
11249
  if (w.config.states.active.filter.type !== "none") {
11188
11250
  if (path.node.getAttribute("selected") === "true") {
@@ -11226,11 +11288,11 @@ class Graphics {
11226
11288
  * @param {any} path @param {any} filters @param {number} i @param {number} j
11227
11289
  * @returns {'true' | 'false'}
11228
11290
  */
11229
- _togglePointSelection(path, filters, i2, j) {
11291
+ _togglePointSelection(path, filters, i2, j2) {
11230
11292
  const w = this.w;
11231
11293
  if (path.node.getAttribute("selected") === "true") {
11232
11294
  path.node.setAttribute("selected", "false");
11233
- const index = w.interact.selectedDataPoints[i2].indexOf(j);
11295
+ const index = w.interact.selectedDataPoints[i2].indexOf(j2);
11234
11296
  if (index > -1) {
11235
11297
  w.interact.selectedDataPoints[i2].splice(index, 1);
11236
11298
  }
@@ -11243,7 +11305,7 @@ class Graphics {
11243
11305
  if (typeof w.interact.selectedDataPoints[i2] === "undefined") {
11244
11306
  w.interact.selectedDataPoints[i2] = [];
11245
11307
  }
11246
- w.interact.selectedDataPoints[i2].push(j);
11308
+ w.interact.selectedDataPoints[i2].push(j2);
11247
11309
  return "true";
11248
11310
  }
11249
11311
  /**
@@ -11287,19 +11349,19 @@ class Graphics {
11287
11349
  const w = this.w;
11288
11350
  const filters = new Filters(this.w);
11289
11351
  const i2 = parseInt((_a = path.node.getAttribute("index")) != null ? _a : "", 10);
11290
- const j = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11291
- if (isNaN(i2) || isNaN(j)) return;
11352
+ const j2 = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11353
+ if (isNaN(i2) || isNaN(j2)) return;
11292
11354
  const link = w.config.chart.link;
11293
11355
  const crossfilterClick = !!(link && (typeof link.dimension === "function" || link.enabled));
11294
11356
  if (!crossfilterClick) {
11295
- const selected = this._togglePointSelection(path, filters, i2, j);
11357
+ const selected = this._togglePointSelection(path, filters, i2, j2);
11296
11358
  this._applyPointSelectionFilter(path, filters, i2, selected);
11297
11359
  }
11298
11360
  if (typeof w.config.chart.events.dataPointSelection === "function") {
11299
11361
  w.config.chart.events.dataPointSelection(e2, this.ctx, {
11300
11362
  selectedDataPoints: w.interact.selectedDataPoints,
11301
11363
  seriesIndex: i2,
11302
- dataPointIndex: j,
11364
+ dataPointIndex: j2,
11303
11365
  w
11304
11366
  });
11305
11367
  }
@@ -11310,7 +11372,7 @@ class Graphics {
11310
11372
  {
11311
11373
  selectedDataPoints: w.interact.selectedDataPoints,
11312
11374
  seriesIndex: i2,
11313
- dataPointIndex: j,
11375
+ dataPointIndex: j2,
11314
11376
  w
11315
11377
  }
11316
11378
  ]);
@@ -12062,9 +12124,9 @@ class Markers {
12062
12124
  /** @type {Record<string, any>} */
12063
12125
  (_e = w.config.series[i2]) == null ? void 0 : _e.data
12064
12126
  );
12065
- for (let j = 0; j < series[i2].length; j++) {
12066
- if (series[i2][j] === null) hasNull = true;
12067
- const d = Array.isArray(data) ? data[j] : null;
12127
+ for (let j2 = 0; j2 < series[i2].length; j2++) {
12128
+ if (series[i2][j2] === null) hasNull = true;
12129
+ const d = Array.isArray(data) ? data[j2] : null;
12068
12130
  if (d && (d.fillColor || d.strokeColor)) {
12069
12131
  perPointStyle = true;
12070
12132
  break;
@@ -12102,7 +12164,7 @@ class Markers {
12102
12164
  plotChartMarkers({
12103
12165
  pointsPos,
12104
12166
  seriesIndex,
12105
- j,
12167
+ j: j2,
12106
12168
  pSize,
12107
12169
  alwaysDrawMarker = false,
12108
12170
  isVirtualPoint = false
@@ -12117,13 +12179,13 @@ class Markers {
12117
12179
  if (Array.isArray(p.x)) {
12118
12180
  for (let q = 0; q < p.x.length; q++) {
12119
12181
  let markerElement;
12120
- let dataPointIndex = j;
12182
+ let dataPointIndex = j2;
12121
12183
  let invalidMarker = !Utils$1.isNumber(p.y[q]);
12122
- if (w.globals.markers.largestSize === 0 && w.globals.hasNullValues && w.seriesData.series[i2][j + 1] !== null && !isVirtualPoint) {
12184
+ if (w.globals.markers.largestSize === 0 && w.globals.hasNullValues && w.seriesData.series[i2][j2 + 1] !== null && !isVirtualPoint) {
12123
12185
  invalidMarker = true;
12124
12186
  }
12125
- if (j === 1 && q === 0) dataPointIndex = 0;
12126
- if (j === 1 && q === 1) dataPointIndex = 1;
12187
+ if (j2 === 1 && q === 0) dataPointIndex = 0;
12188
+ if (j2 === 1 && q === 1) dataPointIndex = 1;
12127
12189
  let markerClasses = "apexcharts-marker";
12128
12190
  if (Markers.markersAreInert(w)) {
12129
12191
  markerClasses += " no-pointer-events";
@@ -12428,7 +12490,7 @@ class Scatter {
12428
12490
  * @param {number} j
12429
12491
  * @param {Record<string, any>} opts
12430
12492
  */
12431
- draw(elSeries, j, opts) {
12493
+ draw(elSeries, j2, opts) {
12432
12494
  const w = this.w;
12433
12495
  const graphics = this.graphics;
12434
12496
  const emit = seriesEmitter(this.ctx, graphics);
@@ -12453,10 +12515,10 @@ class Scatter {
12453
12515
  }
12454
12516
  if (Array.isArray(pointsPos.x)) {
12455
12517
  for (let q = 0; q < pointsPos.x.length; q++) {
12456
- let dataPointIndex = j + 1;
12518
+ let dataPointIndex = j2 + 1;
12457
12519
  let shouldDraw = true;
12458
- if (j === 0 && q === 0) dataPointIndex = 0;
12459
- if (j === 0 && q === 1) dataPointIndex = 1;
12520
+ if (j2 === 0 && q === 0) dataPointIndex = 0;
12521
+ if (j2 === 0 && q === 1) dataPointIndex = 1;
12460
12522
  let radius = w.globals.markers.size[realIndex];
12461
12523
  if (zRatio !== Infinity) {
12462
12524
  const bubble = w.config.plotOptions.bubble;
@@ -12484,7 +12546,7 @@ class Scatter {
12484
12546
  radius,
12485
12547
  realIndex,
12486
12548
  dataPointIndex,
12487
- j
12549
+ j2
12488
12550
  );
12489
12551
  elPointsWrap.add(point);
12490
12552
  if (emit.kind === "canvas") {
@@ -12535,7 +12597,7 @@ class Scatter {
12535
12597
  * @param {number} dataPointIndex
12536
12598
  * @param {number} j
12537
12599
  */
12538
- drawPoint(x, y, radius, realIndex, dataPointIndex, j) {
12600
+ drawPoint(x, y, radius, realIndex, dataPointIndex, j2) {
12539
12601
  var _a;
12540
12602
  const w = this.w;
12541
12603
  const i2 = realIndex;
@@ -12588,7 +12650,7 @@ class Scatter {
12588
12650
  dataPointIndex,
12589
12651
  color: markerConfig.pointFillColor,
12590
12652
  patternUnits: "objectBoundingBox",
12591
- value: w.seriesData.series[realIndex][j]
12653
+ value: w.seriesData.series[realIndex][j2]
12592
12654
  });
12593
12655
  if (ps.fillCacheable === void 0) {
12594
12656
  ps.fillCacheable = ps.canCacheConfig && fill.getFillType(realIndex) === "solid" && typeof markerConfig.pointFillColor === "string" && !!markerConfig.pointFillColor;
@@ -12742,13 +12804,13 @@ class DataLabels {
12742
12804
  };
12743
12805
  }
12744
12806
  /** @param {{type: any, pos: any, i: any, j: any, isRangeStart: any, strokeWidth?: any}} opts */
12745
- drawDataLabel({ type, pos, i: i2, j, isRangeStart, strokeWidth = 2 }) {
12807
+ drawDataLabel({ type, pos, i: i2, j: j2, isRangeStart, strokeWidth = 2 }) {
12746
12808
  const w = this.w;
12747
12809
  const graphics = new Graphics(this.w);
12748
12810
  const dataLabelsConfig = w.config.dataLabels;
12749
12811
  let x = 0;
12750
12812
  let y = 0;
12751
- let dataPointIndex = j;
12813
+ let dataPointIndex = j2;
12752
12814
  let elDataLabelsWrap = null;
12753
12815
  const seriesCollapsed = w.globals.collapsedSeriesIndices.indexOf(i2) !== -1;
12754
12816
  if (seriesCollapsed || !dataLabelsConfig.enabled || !Array.isArray(pos.x)) {
@@ -12758,8 +12820,8 @@ class DataLabels {
12758
12820
  class: "apexcharts-data-labels"
12759
12821
  });
12760
12822
  for (let q = 0; q < pos.x.length; q++) {
12761
- if (j === 1 && q === 0) dataPointIndex = 0;
12762
- if (j === 1 && q === 1) dataPointIndex = 1;
12823
+ if (j2 === 1 && q === 0) dataPointIndex = 0;
12824
+ if (j2 === 1 && q === 1) dataPointIndex = 1;
12763
12825
  x = pos.x[q] + resolveDataLabelOffset(dataLabelsConfig.offsetX, w, i2, dataPointIndex);
12764
12826
  y = pos.y[q] + resolveDataLabelOffset(dataLabelsConfig.offsetY, w, i2, dataPointIndex) + strokeWidth;
12765
12827
  if (!isNaN(x)) {
@@ -12831,7 +12893,7 @@ class DataLabels {
12831
12893
  x,
12832
12894
  y,
12833
12895
  i: i2,
12834
- j,
12896
+ j: j2,
12835
12897
  text,
12836
12898
  textAnchor,
12837
12899
  fontSize,
@@ -12844,7 +12906,7 @@ class DataLabels {
12844
12906
  // some callers (radar) reuse `j` for something other than the data point
12845
12907
  // index, so per-point offsets take these explicit indices when supplied
12846
12908
  seriesIndex = i2,
12847
- dataPointIndex = j
12909
+ dataPointIndex = j2
12848
12910
  } = opts;
12849
12911
  let dataLabelText = null;
12850
12912
  if (Array.isArray(w.config.dataLabels.enabledOnSeries)) {
@@ -12864,7 +12926,7 @@ class DataLabels {
12864
12926
  y,
12865
12927
  text,
12866
12928
  i2,
12867
- j,
12929
+ j2,
12868
12930
  alwaysDrawDataLabel,
12869
12931
  parseInt(
12870
12932
  /** @type {any} */
@@ -12887,14 +12949,14 @@ class DataLabels {
12887
12949
  }
12888
12950
  let dataLabelColor = w.globals.dataLabels.style.colors[i2];
12889
12951
  if ((w.config.chart.type === "bar" || w.config.chart.type === "rangeBar") && w.config.plotOptions.bar.distributed || w.config.dataLabels.distributed) {
12890
- dataLabelColor = w.globals.dataLabels.style.colors[j];
12952
+ dataLabelColor = w.globals.dataLabels.style.colors[j2];
12891
12953
  }
12892
12954
  if (typeof dataLabelColor === "function") {
12893
12955
  dataLabelColor = /** @type {any} */
12894
12956
  dataLabelColor({
12895
12957
  series: w.seriesData.series,
12896
12958
  seriesIndex: i2,
12897
- dataPointIndex: j,
12959
+ dataPointIndex: j2,
12898
12960
  w
12899
12961
  });
12900
12962
  }
@@ -12917,10 +12979,10 @@ class DataLabels {
12917
12979
  let offX = resolvedOffX;
12918
12980
  const offY = resolvedOffY;
12919
12981
  if (w.globals.isSlopeChart) {
12920
- if (j !== 0) {
12982
+ if (j2 !== 0) {
12921
12983
  offX = resolvedOffX * -2 + 5;
12922
12984
  }
12923
- if (j !== 0 && j !== /** @type {Record<string,any>} */
12985
+ if (j2 !== 0 && j2 !== /** @type {Record<string,any>} */
12924
12986
  w.config.series[i2].data.length - 1) {
12925
12987
  offX = 0;
12926
12988
  }
@@ -12956,7 +13018,7 @@ class DataLabels {
12956
13018
  if (typeof w.globals.lastDrawnDataLabelsIndexes[i2] === "undefined") {
12957
13019
  w.globals.lastDrawnDataLabelsIndexes[i2] = [];
12958
13020
  }
12959
- w.globals.lastDrawnDataLabelsIndexes[i2].push(j);
13021
+ w.globals.lastDrawnDataLabelsIndexes[i2].push(j2);
12960
13022
  }
12961
13023
  return dataLabelText;
12962
13024
  }
@@ -14863,14 +14925,14 @@ class Scales {
14863
14925
  /** @type {Record<string,any>} */
14864
14926
  cnf.series[si].group === gn
14865
14927
  ) {
14866
- for (let j = 0; j < this.w.seriesData.series[si].length; j++) {
14867
- const val = this.w.seriesData.series[si][j];
14928
+ for (let j2 = 0; j2 < this.w.seriesData.series[si].length; j2++) {
14929
+ const val = this.w.seriesData.series[si][j2];
14868
14930
  if (val >= 0) {
14869
- posSeries[gni][j] += val;
14931
+ posSeries[gni][j2] += val;
14870
14932
  } else {
14871
- negSeries[gni][j] += val;
14933
+ negSeries[gni][j2] += val;
14872
14934
  }
14873
- sumSeries[gni][j] += val;
14935
+ sumSeries[gni][j2] += val;
14874
14936
  lowestY = Math.min(lowestY, val);
14875
14937
  highestY = Math.max(highestY, val);
14876
14938
  }
@@ -15197,8 +15259,8 @@ class Range {
15197
15259
  } else {
15198
15260
  let yDec = gl.yValueDecimal;
15199
15261
  let hasNulls = false;
15200
- for (let j = firstXIndex; j <= jEnd; j++) {
15201
- const val = arr[j];
15262
+ for (let j2 = firstXIndex; j2 <= jEnd; j2++) {
15263
+ const val = arr[j2];
15202
15264
  if (val !== null && typeof val === "number" && val === val && val !== Infinity && val !== -Infinity) {
15203
15265
  if (val > maxY) maxY = val;
15204
15266
  if (val < lowestY) lowestY = val;
@@ -15237,58 +15299,58 @@ class Range {
15237
15299
  }
15238
15300
  continue;
15239
15301
  }
15240
- for (let j = firstXIndex; j <= lastXIndex && j < this.w.seriesData.series[i2].length; j++) {
15241
- let val = series[i2][j];
15302
+ for (let j2 = firstXIndex; j2 <= lastXIndex && j2 < this.w.seriesData.series[i2].length; j2++) {
15303
+ let val = series[i2][j2];
15242
15304
  if (val !== null && Utils$1.isNumber(val)) {
15243
- if (typeof ((_b = seriesMax[i2]) == null ? void 0 : _b[j]) !== "undefined") {
15244
- maxY = Math.max(maxY, seriesMax[i2][j]);
15245
- lowestY = Math.min(lowestY, seriesMax[i2][j]);
15305
+ if (typeof ((_b = seriesMax[i2]) == null ? void 0 : _b[j2]) !== "undefined") {
15306
+ maxY = Math.max(maxY, seriesMax[i2][j2]);
15307
+ lowestY = Math.min(lowestY, seriesMax[i2][j2]);
15246
15308
  }
15247
- if (typeof ((_c = seriesMin[i2]) == null ? void 0 : _c[j]) !== "undefined") {
15248
- lowestY = Math.min(lowestY, seriesMin[i2][j]);
15249
- highestY = Math.max(highestY, seriesMin[i2][j]);
15309
+ if (typeof ((_c = seriesMin[i2]) == null ? void 0 : _c[j2]) !== "undefined") {
15310
+ lowestY = Math.min(lowestY, seriesMin[i2][j2]);
15311
+ highestY = Math.max(highestY, seriesMin[i2][j2]);
15250
15312
  }
15251
15313
  switch (seriesType) {
15252
15314
  case "candlestick":
15253
15315
  {
15254
- if (typeof this.w.candleData.seriesCandleC[i2][j] !== "undefined") {
15255
- maxY = Math.max(maxY, this.w.candleData.seriesCandleH[i2][j]);
15316
+ if (typeof this.w.candleData.seriesCandleC[i2][j2] !== "undefined") {
15317
+ maxY = Math.max(maxY, this.w.candleData.seriesCandleH[i2][j2]);
15256
15318
  lowestY = Math.min(
15257
15319
  lowestY,
15258
- this.w.candleData.seriesCandleL[i2][j]
15320
+ this.w.candleData.seriesCandleL[i2][j2]
15259
15321
  );
15260
15322
  }
15261
15323
  }
15262
15324
  break;
15263
15325
  case "boxPlot":
15264
15326
  {
15265
- if (typeof this.w.candleData.seriesCandleC[i2][j] !== "undefined") {
15266
- maxY = Math.max(maxY, this.w.candleData.seriesCandleC[i2][j]);
15327
+ if (typeof this.w.candleData.seriesCandleC[i2][j2] !== "undefined") {
15328
+ maxY = Math.max(maxY, this.w.candleData.seriesCandleC[i2][j2]);
15267
15329
  lowestY = Math.min(
15268
15330
  lowestY,
15269
- this.w.candleData.seriesCandleO[i2][j]
15331
+ this.w.candleData.seriesCandleO[i2][j2]
15270
15332
  );
15271
15333
  }
15272
15334
  }
15273
15335
  break;
15274
15336
  case "violin":
15275
15337
  {
15276
- if (typeof ((_d = this.w.violinData.seriesViolinMax[i2]) == null ? void 0 : _d[j]) !== "undefined") {
15277
- maxY = Math.max(maxY, this.w.violinData.seriesViolinMax[i2][j]);
15338
+ if (typeof ((_d = this.w.violinData.seriesViolinMax[i2]) == null ? void 0 : _d[j2]) !== "undefined") {
15339
+ maxY = Math.max(maxY, this.w.violinData.seriesViolinMax[i2][j2]);
15278
15340
  lowestY = Math.min(
15279
15341
  lowestY,
15280
- this.w.violinData.seriesViolinMin[i2][j]
15342
+ this.w.violinData.seriesViolinMin[i2][j2]
15281
15343
  );
15282
15344
  }
15283
15345
  }
15284
15346
  break;
15285
15347
  }
15286
15348
  if (seriesType && seriesType !== "candlestick" && seriesType !== "boxPlot" && seriesType !== "violin" && seriesType !== "rangeArea" && seriesType !== "rangeBar") {
15287
- maxY = Math.max(maxY, this.w.seriesData.series[i2][j]);
15288
- lowestY = Math.min(lowestY, this.w.seriesData.series[i2][j]);
15349
+ maxY = Math.max(maxY, this.w.seriesData.series[i2][j2]);
15350
+ lowestY = Math.min(lowestY, this.w.seriesData.series[i2][j2]);
15289
15351
  }
15290
- if (this.w.seriesData.seriesGoals[i2] && this.w.seriesData.seriesGoals[i2][j] && Array.isArray(this.w.seriesData.seriesGoals[i2][j])) {
15291
- this.w.seriesData.seriesGoals[i2][j].forEach(
15352
+ if (this.w.seriesData.seriesGoals[i2] && this.w.seriesData.seriesGoals[i2][j2] && Array.isArray(this.w.seriesData.seriesGoals[i2][j2])) {
15353
+ this.w.seriesData.seriesGoals[i2][j2].forEach(
15292
15354
  (g) => {
15293
15355
  maxY = Math.max(maxY, g.value);
15294
15356
  lowestY = Math.min(lowestY, g.value);
@@ -15296,7 +15358,7 @@ class Range {
15296
15358
  );
15297
15359
  }
15298
15360
  if (this.w.config.chart.type === "boxPlot" || seriesType === "boxPlot") {
15299
- const boxPts = (_f = (_e = this.w.candleData.seriesBoxPoints) == null ? void 0 : _e[i2]) == null ? void 0 : _f[j];
15361
+ const boxPts = (_f = (_e = this.w.candleData.seriesBoxPoints) == null ? void 0 : _e[i2]) == null ? void 0 : _f[j2];
15300
15362
  if (boxPts) {
15301
15363
  for (let p = 0; p < boxPts.length; p++) {
15302
15364
  const pv = boxPts[p];
@@ -15315,8 +15377,8 @@ class Range {
15315
15377
  val.toString().split(".")[1].length
15316
15378
  );
15317
15379
  }
15318
- if (minY > ((_g = seriesMin[i2]) == null ? void 0 : _g[j]) && ((_h = seriesMin[i2]) == null ? void 0 : _h[j]) < 0) {
15319
- minY = seriesMin[i2][j];
15380
+ if (minY > ((_g = seriesMin[i2]) == null ? void 0 : _g[j2]) && ((_h = seriesMin[i2]) == null ? void 0 : _h[j2]) < 0) {
15381
+ minY = seriesMin[i2][j2];
15320
15382
  }
15321
15383
  } else {
15322
15384
  gl.hasNullValues = true;
@@ -15497,8 +15559,8 @@ class Range {
15497
15559
  if (pe.minX < minX) minX = pe.minX;
15498
15560
  continue;
15499
15561
  }
15500
- for (let j = 0; j < lbls.length; j++) {
15501
- const v = lbls[j];
15562
+ for (let j2 = 0; j2 < lbls.length; j2++) {
15563
+ const v = lbls[j2];
15502
15564
  if (v !== null && typeof v === "number" && v === v) {
15503
15565
  if (v > maxX) maxX = v;
15504
15566
  if (v < minX) minX = v;
@@ -15527,7 +15589,17 @@ class Range {
15527
15589
  let ticks = 10;
15528
15590
  if (cnf.xaxis.tickAmount === void 0) {
15529
15591
  ticks = Math.round(gl.svgWidth / 150);
15530
- if (cnf.xaxis.type === "numeric" && gl.dataPoints < 30) {
15592
+ const inferredNumericX = this.w.axisFlags.isXNumeric && this.w.axisFlags.dataFormatXNumeric && cnf.xaxis.type !== "datetime" && !cnf.xaxis.convertedCatToNumeric && !gl.isBarHorizontal;
15593
+ const fontSize = parseFloat(cnf.xaxis.labels.style.fontSize) || 12;
15594
+ const widestLabelLength = this.w.labelData.labels.reduce(
15595
+ (widest, seriesLabels) => Array.isArray(seriesLabels) ? seriesLabels.reduce(
15596
+ (seriesWidest, label) => Math.max(seriesWidest, String(label).length),
15597
+ widest
15598
+ ) : widest,
15599
+ 0
15600
+ );
15601
+ const allPointLabelsFit = gl.dataPoints * widestLabelLength * fontSize * 0.6 <= gl.svgWidth;
15602
+ if ((cnf.xaxis.type === "numeric" || inferredNumericX && allPointLabelsFit) && gl.dataPoints < 30) {
15531
15603
  ticks = gl.dataPoints - 1;
15532
15604
  }
15533
15605
  if (ticks > gl.dataPoints && gl.dataPoints !== 0) {
@@ -15611,10 +15683,10 @@ class Range {
15611
15683
  if (!this.w.axisFlags.isDataXYZ) return;
15612
15684
  for (let i2 = 0; i2 < this.w.seriesData.series.length; i2++) {
15613
15685
  if (typeof this.w.seriesData.seriesZ[i2] !== "undefined") {
15614
- for (let j = 0; j < this.w.seriesData.seriesZ[i2].length; j++) {
15615
- if (this.w.seriesData.seriesZ[i2][j] !== null && Utils$1.isNumber(this.w.seriesData.seriesZ[i2][j])) {
15616
- gl.maxZ = Math.max(gl.maxZ, this.w.seriesData.seriesZ[i2][j]);
15617
- gl.minZ = Math.min(gl.minZ, this.w.seriesData.seriesZ[i2][j]);
15686
+ for (let j2 = 0; j2 < this.w.seriesData.seriesZ[i2].length; j2++) {
15687
+ if (this.w.seriesData.seriesZ[i2][j2] !== null && Utils$1.isNumber(this.w.seriesData.seriesZ[i2][j2])) {
15688
+ gl.maxZ = Math.max(gl.maxZ, this.w.seriesData.seriesZ[i2][j2]);
15689
+ gl.minZ = Math.min(gl.minZ, this.w.seriesData.seriesZ[i2][j2]);
15618
15690
  }
15619
15691
  }
15620
15692
  }
@@ -15676,8 +15748,8 @@ class Range {
15676
15748
  }
15677
15749
  let presorted = true;
15678
15750
  let minDiff = gl.minXDiff;
15679
- for (let j = 1; j < sX.length; j++) {
15680
- const d = sX[j] - sX[j - 1];
15751
+ for (let j2 = 1; j2 < sX.length; j2++) {
15752
+ const d = sX[j2] - sX[j2 - 1];
15681
15753
  if (d > 0) {
15682
15754
  if (d < minDiff) minDiff = d;
15683
15755
  } else if (d < 0) {
@@ -15694,9 +15766,9 @@ class Range {
15694
15766
  }
15695
15767
  const seriesX = sX.slice();
15696
15768
  seriesX.sort((a2, b) => a2 - b);
15697
- seriesX.forEach((s2, j) => {
15698
- if (j > 0) {
15699
- const xDiff = s2 - seriesX[j - 1];
15769
+ seriesX.forEach((s2, j2) => {
15770
+ if (j2 > 0) {
15771
+ const xDiff = s2 - seriesX[j2 - 1];
15700
15772
  if (xDiff > 0) {
15701
15773
  gl.minXDiff = Math.min(xDiff, gl.minXDiff);
15702
15774
  }
@@ -15730,19 +15802,19 @@ class Range {
15730
15802
  const bounds = windowed ? this._autoScaleXBounds(i2) : null;
15731
15803
  const xs = this.w.seriesData.seriesX[i2];
15732
15804
  const hasX = !!(bounds && xs && xs.length);
15733
- for (let j = 0; j < this.w.seriesData.series[gl.maxValsInArrayIndex].length; j++) {
15734
- if (hasX && (xs[j] < bounds.lo || xs[j] > bounds.hi)) continue;
15735
- if (typeof stackedPoss[group][j] === "undefined") {
15736
- stackedPoss[group][j] = 0;
15737
- stackedNegs[group][j] = 0;
15805
+ for (let j2 = 0; j2 < this.w.seriesData.series[gl.maxValsInArrayIndex].length; j2++) {
15806
+ if (hasX && (xs[j2] < bounds.lo || xs[j2] > bounds.hi)) continue;
15807
+ if (typeof stackedPoss[group][j2] === "undefined") {
15808
+ stackedPoss[group][j2] = 0;
15809
+ stackedNegs[group][j2] = 0;
15738
15810
  }
15739
15811
  const stackSeries = this.w.config.chart.stacked && !gl.comboCharts || this.w.config.chart.stacked && gl.comboCharts && (!this.w.config.chart.stackOnlyBar || /** @type {Record<string,any>} */
15740
15812
  ((_b = (_a = this.w.config.series) == null ? void 0 : _a[i2]) == null ? void 0 : _b.type) === "bar" || /** @type {Record<string,any>} */
15741
15813
  ((_d = (_c = this.w.config.series) == null ? void 0 : _c[i2]) == null ? void 0 : _d.type) === "column");
15742
15814
  if (stackSeries) {
15743
- if (this.w.seriesData.series[i2][j] !== null && Utils$1.isNumber(this.w.seriesData.series[i2][j])) {
15744
- this.w.seriesData.series[i2][j] > 0 ? stackedPoss[group][j] += parseFloat(String(this.w.seriesData.series[i2][j])) + 1e-4 : stackedNegs[group][j] += parseFloat(
15745
- String(this.w.seriesData.series[i2][j])
15815
+ if (this.w.seriesData.series[i2][j2] !== null && Utils$1.isNumber(this.w.seriesData.series[i2][j2])) {
15816
+ this.w.seriesData.series[i2][j2] > 0 ? stackedPoss[group][j2] += parseFloat(String(this.w.seriesData.series[i2][j2])) + 1e-4 : stackedNegs[group][j2] += parseFloat(
15817
+ String(this.w.seriesData.series[i2][j2])
15746
15818
  );
15747
15819
  }
15748
15820
  }
@@ -16222,42 +16294,30 @@ class YAxis {
16222
16294
  }
16223
16295
  setYAxisTextAlignments() {
16224
16296
  const w = this.w;
16225
- const yaxis = Array.from(
16226
- w.dom.baseEl.getElementsByClassName("apexcharts-yaxis")
16227
- );
16228
- yaxis.forEach((y, index) => {
16229
- const yaxe = w.config.yaxis[index];
16297
+ w.config.yaxis.forEach((yaxe, index) => {
16230
16298
  if (yaxe && !yaxe.floating && yaxe.labels.align !== void 0) {
16231
16299
  const yAxisInner = w.dom.baseEl.querySelector(
16232
16300
  `.apexcharts-yaxis[rel='${index}'] .apexcharts-yaxis-texts-g`
16233
16301
  );
16302
+ if (!yAxisInner) return;
16234
16303
  const yAxisTexts = Array.from(
16235
16304
  w.dom.baseEl.querySelectorAll(
16236
16305
  `.apexcharts-yaxis[rel='${index}'] .apexcharts-yaxis-label`
16237
16306
  )
16238
16307
  );
16239
- const rect = (
16240
- /** @type {Element} */
16241
- yAxisInner.getBoundingClientRect()
16242
- );
16308
+ const rect = yAxisInner.getBoundingClientRect();
16243
16309
  yAxisTexts.forEach((label) => {
16244
16310
  label.setAttribute("text-anchor", yaxe.labels.align);
16245
16311
  });
16246
16312
  if (yaxe.labels.align === "left" && !yaxe.opposite) {
16247
- yAxisInner.setAttribute(
16248
- "transform",
16249
- `translate(-${rect.width}, 0)`
16250
- );
16313
+ yAxisInner.setAttribute("transform", `translate(-${rect.width}, 0)`);
16251
16314
  } else if (yaxe.labels.align === "center") {
16252
16315
  yAxisInner.setAttribute(
16253
16316
  "transform",
16254
16317
  `translate(${rect.width / 2 * (!yaxe.opposite ? -1 : 1)}, 0)`
16255
16318
  );
16256
16319
  } else if (yaxe.labels.align === "right" && yaxe.opposite) {
16257
- yAxisInner.setAttribute(
16258
- "transform",
16259
- `translate(${rect.width}, 0)`
16260
- );
16320
+ yAxisInner.setAttribute("transform", `translate(${rect.width}, 0)`);
16261
16321
  }
16262
16322
  }
16263
16323
  });
@@ -16695,15 +16755,15 @@ function captureStreamFrame(w) {
16695
16755
  w.dom.baseEl.querySelectorAll(".apexcharts-marker").forEach((node) => {
16696
16756
  var _a2, _b2, _c2, _d, _e;
16697
16757
  const ri = parseInt((_a2 = node.getAttribute("index")) != null ? _a2 : "", 10);
16698
- const j = parseInt(
16758
+ const j2 = parseInt(
16699
16759
  (_c2 = (_b2 = node.getAttribute("j")) != null ? _b2 : node.getAttribute("rel")) != null ? _c2 : "",
16700
16760
  10
16701
16761
  );
16702
16762
  const r2 = parseFloat(
16703
16763
  (_e = (_d = node.getAttribute("r")) != null ? _d : node.getAttribute("default-marker-size")) != null ? _e : ""
16704
16764
  );
16705
- if (isFinite(ri) && isFinite(j) && isFinite(r2)) {
16706
- (rPixels[ri] = rPixels[ri] || [])[j] = r2;
16765
+ if (isFinite(ri) && isFinite(j2) && isFinite(r2)) {
16766
+ (rPixels[ri] = rPixels[ri] || [])[j2] = r2;
16707
16767
  }
16708
16768
  });
16709
16769
  }
@@ -16758,29 +16818,29 @@ function lengthTransitionEnabled(w) {
16758
16818
  if (largeThreshold > 0 && w.globals.dataPoints > largeThreshold) return false;
16759
16819
  return !!(Environment.isBrowser() && w.globals.dataChanged && w.globals.shouldAnimate);
16760
16820
  }
16761
- function datumKey(w, realIndex, j) {
16821
+ function datumKey(w, realIndex, j2) {
16762
16822
  var _a, _b, _c, _d;
16763
16823
  if ((_a = w.axisFlags) == null ? void 0 : _a.isXNumeric) {
16764
16824
  const sx = (_c = (_b = w.seriesData) == null ? void 0 : _b.seriesX) == null ? void 0 : _c[realIndex];
16765
- if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
16825
+ if (sx && sx.length && sx[j2] != null) return "x:" + sx[j2];
16766
16826
  }
16767
- const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j];
16827
+ const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j2];
16768
16828
  if (lbl != null && String(lbl) !== "") {
16769
16829
  return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
16770
16830
  }
16771
- return "j:" + j;
16831
+ return "j:" + j2;
16772
16832
  }
16773
- function frameDatumKey(frame, realIndex, j) {
16833
+ function frameDatumKey(frame, realIndex, j2) {
16774
16834
  var _a, _b;
16775
16835
  if (frame.isXNumeric) {
16776
16836
  const sx = (_a = frame.seriesX) == null ? void 0 : _a[realIndex];
16777
- if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
16837
+ if (sx && sx.length && sx[j2] != null) return "x:" + sx[j2];
16778
16838
  }
16779
- const lbl = (_b = frame.labels) == null ? void 0 : _b[j];
16839
+ const lbl = (_b = frame.labels) == null ? void 0 : _b[j2];
16780
16840
  if (lbl != null && String(lbl) !== "") {
16781
16841
  return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
16782
16842
  }
16783
- return "j:" + j;
16843
+ return "j:" + j2;
16784
16844
  }
16785
16845
  function joinKeys(oldKeys, newKeys) {
16786
16846
  const oldIndex = /* @__PURE__ */ new Map();
@@ -16826,9 +16886,9 @@ function seriesJoin(w, realIndex, includeIdentity = false, allowReorder = false)
16826
16886
  if (!Array.isArray(oldY) || !Array.isArray(newY)) return null;
16827
16887
  if (!oldY.length || !newY.length) return null;
16828
16888
  const oldKeys = uniquifyKeys(
16829
- oldY.map((_, j) => frameDatumKey(frame, realIndex, j))
16889
+ oldY.map((_, j2) => frameDatumKey(frame, realIndex, j2))
16830
16890
  );
16831
- const newKeys = uniquifyKeys(newY.map((_, j) => datumKey(w, realIndex, j)));
16891
+ const newKeys = uniquifyKeys(newY.map((_, j2) => datumKey(w, realIndex, j2)));
16832
16892
  const join = joinKeys(oldKeys, newKeys);
16833
16893
  if (!join.ordered && !allowReorder) return null;
16834
16894
  if (!join.changed && !includeIdentity) return null;
@@ -17370,7 +17430,7 @@ function applyDataLabelTransition(w) {
17370
17430
  }
17371
17431
  if (countUp && old) {
17372
17432
  const realIndex = parseInt(key, 10);
17373
- const j = parseInt(group.getAttribute("data:dlJ") || "", 10);
17433
+ const j2 = parseInt(group.getAttribute("data:dlJ") || "", 10);
17374
17434
  countUpText(w, {
17375
17435
  el: textEl,
17376
17436
  from: old.val,
@@ -17381,7 +17441,7 @@ function applyDataLabelTransition(w) {
17381
17441
  // of `w` on every frame. Same shape the bar formatter gets.
17382
17442
  fmtOpts: __spreadProps(__spreadValues({}, w), {
17383
17443
  seriesIndex: realIndex,
17384
- dataPointIndex: isFinite(j) ? j : 0,
17444
+ dataPointIndex: isFinite(j2) ? j2 : 0,
17385
17445
  w
17386
17446
  }),
17387
17447
  duration,
@@ -17668,20 +17728,20 @@ class Series {
17668
17728
  const nextRecords = [];
17669
17729
  const nextIndices = [];
17670
17730
  records.forEach((rec) => {
17671
- const j = rec && rec.name != null ? newNames.indexOf(rec.name) : rec.index;
17672
- if (j == null || j < 0 || j >= target.length) return;
17731
+ const j2 = rec && rec.name != null ? newNames.indexOf(rec.name) : rec.index;
17732
+ if (j2 == null || j2 < 0 || j2 >= target.length) return;
17673
17733
  const s2 = (
17674
17734
  /** @type {any} */
17675
- target[j]
17735
+ target[j2]
17676
17736
  );
17677
- rec.index = j;
17737
+ rec.index = j2;
17678
17738
  if (gl.axisCharts) {
17679
17739
  if (s2 && Array.isArray(s2.data) && s2.data.length) rec.data = s2.data.slice();
17680
17740
  } else {
17681
17741
  rec.data = s2;
17682
17742
  }
17683
17743
  nextRecords.push(rec);
17684
- nextIndices.push(j);
17744
+ nextIndices.push(j2);
17685
17745
  });
17686
17746
  return { records: nextRecords, indices: nextIndices };
17687
17747
  };
@@ -17949,14 +18009,14 @@ class Series {
17949
18009
  ),
17950
18010
  realIndex: seriesEls[i2].getAttribute("data:realIndex")
17951
18011
  };
17952
- for (let j = 0; j < paths.length; j++) {
17953
- if (paths[j].hasAttribute("pathTo")) {
17954
- const d = paths[j].getAttribute("pathTo");
18012
+ for (let j2 = 0; j2 < paths.length; j2++) {
18013
+ if (paths[j2].hasAttribute("pathTo")) {
18014
+ const d = paths[j2].getAttribute("pathTo");
17955
18015
  dArr.paths.push({
17956
18016
  d,
17957
- key: paths[j].getAttribute("data:pathKey"),
17958
- fill: paths[j].getAttribute("fill"),
17959
- flip: paths[j].classList.contains("apexcharts-flip-y") || paths[j].classList.contains("apexcharts-flip-x")
18017
+ key: paths[j2].getAttribute("data:pathKey"),
18018
+ fill: paths[j2].getAttribute("fill"),
18019
+ flip: paths[j2].classList.contains("apexcharts-flip-y") || paths[j2].classList.contains("apexcharts-flip-x")
17960
18020
  });
17961
18021
  }
17962
18022
  }
@@ -18067,7 +18127,7 @@ class Series {
18067
18127
  const w = this.w;
18068
18128
  for (let sl = 0; sl < series.length; sl++) {
18069
18129
  if (series[sl].length === 0) {
18070
- for (let j = 0; j < series[w.globals.maxValsInArrayIndex].length; j++) {
18130
+ for (let j2 = 0; j2 < series[w.globals.maxValsInArrayIndex].length; j2++) {
18071
18131
  series[sl].push(0);
18072
18132
  }
18073
18133
  }
@@ -19257,8 +19317,8 @@ class DimGrid {
19257
19317
  if (!totals.length) return;
19258
19318
  const formatter = totalConfig.formatter || w.config.dataLabels.formatter;
19259
19319
  const labels = totals.map(
19260
- (val, j) => String(
19261
- formatter ? formatter(val, __spreadProps(__spreadValues({}, w), { seriesIndex: 0, dataPointIndex: j, w })) : val
19320
+ (val, j2) => String(
19321
+ formatter ? formatter(val, __spreadProps(__spreadValues({}, w), { seriesIndex: 0, dataPointIndex: j2, w })) : val
19262
19322
  )
19263
19323
  );
19264
19324
  const graphics = new Graphics(w);
@@ -20953,7 +21013,7 @@ function toNode(w, d, i2, paletteFromParent, parentKey, seenIds = null, opts = {
20953
21013
  if (opts.keepDatum) node._datum = d;
20954
21014
  if (isObj && Array.isArray(d.children) && d.children.length) {
20955
21015
  node.children = d.children.map(
20956
- (c, j) => toNode(w, c, j, null, node._key, seenIds, opts)
21016
+ (c, j2) => toNode(w, c, j2, null, node._key, seenIds, opts)
20957
21017
  );
20958
21018
  } else if (isObj && d.drilldown != null && opts.expandDrilldown !== false) {
20959
21019
  const visited = seenIds || /* @__PURE__ */ new Set();
@@ -20964,7 +21024,7 @@ function toNode(w, d, i2, paletteFromParent, parentKey, seenIds = null, opts = {
20964
21024
  nextSeen.add(d.drilldown);
20965
21025
  const palette = Array.isArray(dd.colors) ? dd.colors : null;
20966
21026
  node.children = dd.data.map(
20967
- (c, j) => toNode(w, c, j, palette, node._key, nextSeen, opts)
21027
+ (c, j2) => toNode(w, c, j2, palette, node._key, nextSeen, opts)
20968
21028
  );
20969
21029
  }
20970
21030
  }
@@ -20988,7 +21048,7 @@ function buildSeriesRoots(w, series, opts = {}) {
20988
21048
  _key: key,
20989
21049
  _seriesIndex: i2,
20990
21050
  children: data.map(
20991
- (d, j) => toNode(w, d, j, null, key, null, opts)
21051
+ (d, j2) => toNode(w, d, j2, null, key, null, opts)
20992
21052
  )
20993
21053
  };
20994
21054
  return root;
@@ -21012,8 +21072,8 @@ function hasNesting(series, opts = {}) {
21012
21072
  for (let i2 = 0; i2 < series.length; i2++) {
21013
21073
  const data = series[i2] && series[i2].data;
21014
21074
  if (!Array.isArray(data)) continue;
21015
- for (let j = 0; j < data.length; j++) {
21016
- const d = data[j];
21075
+ for (let j2 = 0; j2 < data.length; j2++) {
21076
+ const d = data[j2];
21017
21077
  if (!d || typeof d !== "object") continue;
21018
21078
  if (Array.isArray(d.children) && d.children.length) return true;
21019
21079
  if (countDrilldown && d.drilldown != null) return true;
@@ -21170,8 +21230,8 @@ class Data {
21170
21230
  let xSorted = true;
21171
21231
  let minXDiff = Infinity;
21172
21232
  let prevX = NaN;
21173
- for (let j = 0; j < n2; j++) {
21174
- const point = data[j];
21233
+ for (let j2 = 0; j2 < n2; j2++) {
21234
+ const point = data[j2];
21175
21235
  if (!Array.isArray(point) || point.length > 2) return false;
21176
21236
  const x = point[0];
21177
21237
  const y = point[1];
@@ -21219,8 +21279,8 @@ class Data {
21219
21279
  } else {
21220
21280
  return false;
21221
21281
  }
21222
- ys[j] = y;
21223
- xs[j] = x;
21282
+ ys[j2] = y;
21283
+ xs[j2] = x;
21224
21284
  }
21225
21285
  this.twoDSeries = ys;
21226
21286
  this.twoDSeriesX = xs;
@@ -21255,8 +21315,8 @@ class Data {
21255
21315
  if (!isBoxPlot && cnf.xaxis.type !== "datetime" && this._fast2DArrayParse(data, i2)) {
21256
21316
  return;
21257
21317
  }
21258
- for (let j = 0; j < data.length; j++) {
21259
- const point = data[j];
21318
+ for (let j2 = 0; j2 < data.length; j2++) {
21319
+ const point = data[j2];
21260
21320
  const x = point[0];
21261
21321
  const y = point[1];
21262
21322
  const z = point[2];
@@ -21296,8 +21356,8 @@ class Data {
21296
21356
  activeI = this.activeSeriesIndex;
21297
21357
  }
21298
21358
  const activeData = ser[activeI].data;
21299
- for (let j = 0; j < data.length; j++) {
21300
- const point = data[j];
21359
+ for (let j2 = 0; j2 < data.length; j2++) {
21360
+ const point = data[j2];
21301
21361
  if (typeof point.y !== "undefined") {
21302
21362
  const val = Array.isArray(point.y) ? Utils$1.parseNumber(point.y[point.y.length - 1]) : Utils$1.parseNumber(point.y);
21303
21363
  this.twoDSeries.push(val);
@@ -21315,8 +21375,8 @@ class Data {
21315
21375
  this.w.axisFlags.isDataXYZ = true;
21316
21376
  }
21317
21377
  }
21318
- for (let j = 0; j < activeData.length; j++) {
21319
- const point = activeData[j];
21378
+ for (let j2 = 0; j2 < activeData.length; j2++) {
21379
+ const point = activeData[j2];
21320
21380
  const x = point.x;
21321
21381
  const isXString = typeof x === "string";
21322
21382
  const isXArr = Array.isArray(x);
@@ -21423,12 +21483,12 @@ class Data {
21423
21483
  const data = ser[i2].data || [];
21424
21484
  const start = [];
21425
21485
  const end = [];
21426
- for (let j = 0; j < data.length; j++) {
21427
- const datum = data[j];
21486
+ for (let j2 = 0; j2 < data.length; j2++) {
21487
+ const datum = data[j2];
21428
21488
  let lo;
21429
21489
  let hi;
21430
21490
  if (typeof yExtent === "function") {
21431
- let ext = yExtent(datum, j);
21491
+ let ext = yExtent(datum, j2);
21432
21492
  if (!Array.isArray(ext)) ext = [ext];
21433
21493
  const nums = ext.map((v) => Utils$1.parseNumber(v)).filter((v) => v !== null && !isNaN(v));
21434
21494
  lo = nums.length ? Math.min(...nums) : null;
@@ -21495,8 +21555,8 @@ class Data {
21495
21555
  const minArr = [];
21496
21556
  const maxArr = [];
21497
21557
  const placeholders = [];
21498
- for (let j = 0; j < data.length; j++) {
21499
- const d = data[j];
21558
+ for (let j2 = 0; j2 < data.length; j2++) {
21559
+ const d = data[j2];
21500
21560
  const dens = (_c = (_b = (_a = d == null ? void 0 : d.y) == null ? void 0 : _a.density) != null ? _b : d == null ? void 0 : d[1]) != null ? _c : [];
21501
21561
  const pts = (_f = (_e = (_d = d == null ? void 0 : d.y) == null ? void 0 : _d.points) != null ? _e : d == null ? void 0 : d[2]) != null ? _f : [];
21502
21562
  const summary = this._parseViolinSummary((_h = (_g = d == null ? void 0 : d.y) == null ? void 0 : _g.summary) != null ? _h : d == null ? void 0 : d[3]);
@@ -21588,29 +21648,29 @@ class Data {
21588
21648
  }
21589
21649
  });
21590
21650
  if (format === "array") {
21591
- for (let j = 0; j < ser[i2].data.length; j++) {
21592
- if (Array.isArray(ser[i2].data[j])) {
21593
- rangeStart.push(ser[i2].data[j][1][0]);
21594
- rangeEnd.push(ser[i2].data[j][1][1]);
21651
+ for (let j2 = 0; j2 < ser[i2].data.length; j2++) {
21652
+ if (Array.isArray(ser[i2].data[j2])) {
21653
+ rangeStart.push(ser[i2].data[j2][1][0]);
21654
+ rangeEnd.push(ser[i2].data[j2][1][1]);
21595
21655
  } else {
21596
- rangeStart.push(ser[i2].data[j]);
21597
- rangeEnd.push(ser[i2].data[j]);
21656
+ rangeStart.push(ser[i2].data[j2]);
21657
+ rangeEnd.push(ser[i2].data[j2]);
21598
21658
  }
21599
21659
  }
21600
21660
  } else if (format === "xy") {
21601
- for (let j = 0; j < ser[i2].data.length; j++) {
21602
- const isDataPoint2D = Array.isArray(ser[i2].data[j].y);
21661
+ for (let j2 = 0; j2 < ser[i2].data.length; j2++) {
21662
+ const isDataPoint2D = Array.isArray(ser[i2].data[j2].y);
21603
21663
  const id = Utils$1.randomId();
21604
- const x = ser[i2].data[j].x;
21664
+ const x = ser[i2].data[j2].x;
21605
21665
  const y = {
21606
- y1: isDataPoint2D ? ser[i2].data[j].y[0] : ser[i2].data[j].y,
21607
- y2: isDataPoint2D ? ser[i2].data[j].y[1] : ser[i2].data[j].y,
21666
+ y1: isDataPoint2D ? ser[i2].data[j2].y[0] : ser[i2].data[j2].y,
21667
+ y2: isDataPoint2D ? ser[i2].data[j2].y[1] : ser[i2].data[j2].y,
21608
21668
  rangeName: id
21609
21669
  };
21610
21670
  const gl = this.w.globals;
21611
21671
  if (!gl.seriesRangeName) gl.seriesRangeName = {};
21612
21672
  if (!gl.seriesRangeName[i2]) gl.seriesRangeName[i2] = {};
21613
- gl.seriesRangeName[i2][j] = id;
21673
+ gl.seriesRangeName[i2][j2] = id;
21614
21674
  const keyObj = uniqueKeysMap.get(x);
21615
21675
  if (keyObj) {
21616
21676
  keyObj.y.push(y);
@@ -21653,8 +21713,8 @@ class Data {
21653
21713
  } else {
21654
21714
  getVals = (d) => Array.isArray(d.y) ? d.y : [];
21655
21715
  }
21656
- for (let j = 0; j < data.length; j++) {
21657
- const vals = getVals(data[j]);
21716
+ for (let j2 = 0; j2 < data.length; j2++) {
21717
+ const vals = getVals(data[j2]);
21658
21718
  if (vals && vals.length >= 2) {
21659
21719
  serO.push(vals[0]);
21660
21720
  serH.push(vals[1]);
@@ -21667,8 +21727,8 @@ class Data {
21667
21727
  serC.push(vals[3]);
21668
21728
  }
21669
21729
  }
21670
- const pts = data[j] && /** @type {any} */
21671
- data[j].points;
21730
+ const pts = data[j2] && /** @type {any} */
21731
+ data[j2].points;
21672
21732
  serPoints.push(Array.isArray(pts) ? pts : []);
21673
21733
  }
21674
21734
  return {
@@ -21716,18 +21776,18 @@ class Data {
21716
21776
  });
21717
21777
  this.w.labelData.seriesGroups = buckets;
21718
21778
  const handleDates = () => {
21719
- for (let j = 0; j < xlabels.length; j++) {
21720
- if (typeof xlabels[j] === "string") {
21721
- const isDate = dt.isValidDate(xlabels[j]);
21779
+ for (let j2 = 0; j2 < xlabels.length; j2++) {
21780
+ if (typeof xlabels[j2] === "string") {
21781
+ const isDate = dt.isValidDate(xlabels[j2]);
21722
21782
  if (isDate) {
21723
- this.twoDSeriesX.push(dt.parseDate(xlabels[j]));
21783
+ this.twoDSeriesX.push(dt.parseDate(xlabels[j2]));
21724
21784
  } else {
21725
21785
  throw new Error(
21726
21786
  "You have provided invalid Date format. Please provide a valid JavaScript Date"
21727
21787
  );
21728
21788
  }
21729
21789
  } else {
21730
- this.twoDSeriesX.push(xlabels[j]);
21790
+ this.twoDSeriesX.push(xlabels[j2]);
21731
21791
  }
21732
21792
  }
21733
21793
  };
@@ -22470,8 +22530,11 @@ class Data {
22470
22530
  // Segregate user provided data into appropriate vars
22471
22531
  /**
22472
22532
  * @param {any[]} ser
22533
+ * @param {boolean} [overwriteInitialSeries=true] false when the caller hands
22534
+ * back the series the chart already has (an internal re-render), so the
22535
+ * baseline resetSeries() restores must not move.
22473
22536
  */
22474
- parseData(ser) {
22537
+ parseData(ser, overwriteInitialSeries = true) {
22475
22538
  var _a, _b, _c, _d, _e, _f, _g;
22476
22539
  const w = this.w;
22477
22540
  const cnf = w.config;
@@ -22504,7 +22567,8 @@ class Data {
22504
22567
  ser = ser.map((s2) => __spreadValues({}, s2));
22505
22568
  }
22506
22569
  cnf.series = ser;
22507
- if (gl.dataReducerRawSeries && ((_g = cnf.chart.dataReducer) == null ? void 0 : _g.enabled)) {
22570
+ if (!overwriteInitialSeries) ;
22571
+ else if (gl.dataReducerRawSeries && ((_g = cnf.chart.dataReducer) == null ? void 0 : _g.enabled)) {
22508
22572
  const stash = gl.dataReducerRawSeries;
22509
22573
  gl.initialSeries = ser.map((s2, i2) => {
22510
22574
  var _a2, _b2, _c2;
@@ -22723,9 +22787,9 @@ class Data {
22723
22787
  let avgX = 0;
22724
22788
  let avgY = 0;
22725
22789
  const avgRangeLen = avgRangeEnd - avgRangeStart;
22726
- for (let j = avgRangeStart; j < avgRangeEnd; j++) {
22727
- avgX += getX(data[j]);
22728
- avgY += getY(data[j]);
22790
+ for (let j2 = avgRangeStart; j2 < avgRangeEnd; j2++) {
22791
+ avgX += getX(data[j2]);
22792
+ avgY += getY(data[j2]);
22729
22793
  }
22730
22794
  avgX /= avgRangeLen;
22731
22795
  avgY /= avgRangeLen;
@@ -22735,13 +22799,13 @@ class Data {
22735
22799
  const pointAY = getY(data[a2]);
22736
22800
  let maxArea = -1;
22737
22801
  let maxAreaIdx = rangeStart;
22738
- for (let j = rangeStart; j < rangeEnd; j++) {
22802
+ for (let j2 = rangeStart; j2 < rangeEnd; j2++) {
22739
22803
  const area = Math.abs(
22740
- (pointAX - avgX) * (getY(data[j]) - pointAY) - (pointAX - getX(data[j])) * (avgY - pointAY)
22804
+ (pointAX - avgX) * (getY(data[j2]) - pointAY) - (pointAX - getX(data[j2])) * (avgY - pointAY)
22741
22805
  ) * 0.5;
22742
22806
  if (area > maxArea) {
22743
22807
  maxArea = area;
22744
- maxAreaIdx = j;
22808
+ maxAreaIdx = j2;
22745
22809
  }
22746
22810
  }
22747
22811
  sampled.push(data[maxAreaIdx]);
@@ -22783,8 +22847,8 @@ class Data {
22783
22847
  let high = firstY[1];
22784
22848
  let low = firstY[2];
22785
22849
  let close = firstY[3];
22786
- for (let j = start + 1; j < end; j++) {
22787
- const y = getY(data[j]);
22850
+ for (let j2 = start + 1; j2 < end; j2++) {
22851
+ const y = getY(data[j2]);
22788
22852
  if (y[1] > high) high = y[1];
22789
22853
  if (y[2] < low) low = y[2];
22790
22854
  close = y[3];
@@ -22824,8 +22888,8 @@ class Data {
22824
22888
  if (end <= start) continue;
22825
22889
  let low = Infinity;
22826
22890
  let high = -Infinity;
22827
- for (let j = start; j < end; j++) {
22828
- const y = getY(data[j]);
22891
+ for (let j2 = start; j2 < end; j2++) {
22892
+ const y = getY(data[j2]);
22829
22893
  if (y == null) continue;
22830
22894
  for (let k = 0; k < 2; k++) {
22831
22895
  const v = y[k];
@@ -22944,7 +23008,9 @@ class UpdateHelpers {
22944
23008
  );
22945
23009
  initialConfig.series = !options2.series && prevInitialSeries ? prevInitialSeries : Utils$1.copySeriesShallow(w.config.series);
22946
23010
  w.globals.initialConfig = initialConfig;
22947
- w.globals.initialSeries = w.config.series;
23011
+ if (options2.series) {
23012
+ w.globals.initialSeries = w.config.series;
23013
+ }
22948
23014
  }
22949
23015
  if (options2.series && (w.globals.collapsedSeriesIndices.length > 0 || w.globals.ancillaryCollapsedSeriesIndices.length > 0)) {
22950
23016
  ch.series.reconcileCollapsedByName();
@@ -22993,14 +23059,20 @@ class UpdateHelpers {
22993
23059
  w.globals.streamgraphRawSeries = null;
22994
23060
  w.globals.treemapRawSeries = null;
22995
23061
  }
23062
+ const definedSeries = newSeries;
23063
+ let reconciledCollapses = false;
22996
23064
  if (w.globals.axisCharts && (w.globals.collapsedSeriesIndices.length > 0 || w.globals.ancillaryCollapsedSeriesIndices.length > 0)) {
22997
23065
  newSeries = newSeries.map(
22998
23066
  (s2) => s2 && typeof s2 === "object" ? __spreadValues({}, s2) : s2
22999
23067
  );
23000
23068
  this.ctx.series.reconcileCollapsedByName(newSeries);
23069
+ reconciledCollapses = true;
23001
23070
  }
23002
23071
  this.ctx.data.resetParsingFlags();
23003
- const parsedState = this.ctx.data.parseData(newSeries);
23072
+ const parsedState = this.ctx.data.parseData(
23073
+ newSeries,
23074
+ overwriteInitialSeries
23075
+ );
23004
23076
  this.ctx._writeParsedSeriesData(parsedState.seriesData);
23005
23077
  this.ctx._writeParsedRangeData(parsedState.rangeData);
23006
23078
  this.ctx._writeParsedCandleData(parsedState.candleData);
@@ -23009,10 +23081,12 @@ class UpdateHelpers {
23009
23081
  if (overwriteInitialSeries) {
23010
23082
  if (w.globals.initialConfig) {
23011
23083
  w.globals.initialConfig.series = Utils$1.copySeriesShallow(
23012
- w.config.series
23084
+ reconciledCollapses ? definedSeries : w.config.series
23013
23085
  );
23014
23086
  }
23015
- w.globals.initialSeries = w.config.series;
23087
+ if (reconciledCollapses) {
23088
+ w.globals.initialSeries = definedSeries;
23089
+ }
23016
23090
  }
23017
23091
  if (this._canUseFastPath(newSeries, prevSeriesCount, prevDataLengths, w)) {
23018
23092
  return this.ctx.fastUpdate(animate, prevAxisScaleSig).then(() => {
@@ -23343,11 +23417,11 @@ class Utils2 {
23343
23417
  hoverArea.classList.add("hovering-pan");
23344
23418
  }
23345
23419
  }
23346
- let j = Math.round(hoverX / xDivisor);
23420
+ let j2 = Math.round(hoverX / xDivisor);
23347
23421
  const jHorz = Math.floor(hoverY / yDivisor);
23348
23422
  if (hasBars && !w.config.xaxis.convertedCatToNumeric) {
23349
- j = Math.ceil(hoverX / xDivisor);
23350
- j = j - 1;
23423
+ j2 = Math.ceil(hoverX / xDivisor);
23424
+ j2 = j2 - 1;
23351
23425
  }
23352
23426
  let capturedSeries = null;
23353
23427
  let closest = null;
@@ -23373,7 +23447,7 @@ class Utils2 {
23373
23447
  seriesYValArr
23374
23448
  );
23375
23449
  capturedSeries = closest.index;
23376
- j = (_a = closest.j) != null ? _a : 0;
23450
+ j2 = (_a = closest.j) != null ? _a : 0;
23377
23451
  const wasCompacted = seriesXValArr.some(
23378
23452
  (arr, i2) => arr.length !== w.globals.seriesXvalues[i2].length
23379
23453
  );
@@ -23389,19 +23463,19 @@ class Utils2 {
23389
23463
  nearest = i2;
23390
23464
  }
23391
23465
  }
23392
- if (nearest !== null) j = nearest;
23466
+ if (nearest !== null) j2 = nearest;
23393
23467
  }
23394
23468
  }
23395
23469
  w.interact.capturedSeriesIndex = capturedSeries === null ? -1 : capturedSeries;
23396
- if (!j || j < 1) j = 0;
23470
+ if (!j2 || j2 < 1) j2 = 0;
23397
23471
  if (w.globals.isBarHorizontal) {
23398
23472
  w.interact.capturedDataPointIndex = jHorz;
23399
23473
  } else {
23400
- w.interact.capturedDataPointIndex = j;
23474
+ w.interact.capturedDataPointIndex = j2;
23401
23475
  }
23402
23476
  return {
23403
23477
  capturedSeries,
23404
- j: w.globals.isBarHorizontal ? jHorz : j,
23478
+ j: w.globals.isBarHorizontal ? jHorz : j2,
23405
23479
  hoverX,
23406
23480
  hoverY
23407
23481
  };
@@ -23448,11 +23522,11 @@ class Utils2 {
23448
23522
  const xArr = Xarrays[i2];
23449
23523
  const yArr = Yarrays[i2];
23450
23524
  const len = Math.min(xArr.length, yArr.length);
23451
- for (let j = 0; j < len; j++) {
23452
- const distX = Math.abs(hoverX - xArr[j]);
23525
+ for (let j2 = 0; j2 < len; j2++) {
23526
+ const distX = Math.abs(hoverX - xArr[j2]);
23453
23527
  if (distX < bucketDistX) {
23454
23528
  bucketDistX = distX;
23455
- closestPointIndex = j;
23529
+ closestPointIndex = j2;
23456
23530
  }
23457
23531
  }
23458
23532
  }
@@ -23474,14 +23548,14 @@ class Utils2 {
23474
23548
  }
23475
23549
  continue;
23476
23550
  }
23477
- for (let j = 0; j < len - 1; j++) {
23551
+ for (let j2 = 0; j2 < len - 1; j2++) {
23478
23552
  const seg = this._distanceToSegment(
23479
23553
  hoverX,
23480
23554
  hoverY,
23481
- xArr[j],
23482
- yArr[j],
23483
- xArr[j + 1],
23484
- yArr[j + 1]
23555
+ xArr[j2],
23556
+ yArr[j2],
23557
+ xArr[j2 + 1],
23558
+ yArr[j2 + 1]
23485
23559
  );
23486
23560
  if (seg.dist < bestSegDist) {
23487
23561
  bestSegDist = seg.dist;
@@ -23516,33 +23590,33 @@ class Utils2 {
23516
23590
  const yArr = Yarrays[i2];
23517
23591
  const len = Math.min(xArr.length, yArr.length);
23518
23592
  if (isLineArea && len >= 2) {
23519
- for (let j = 0; j < len - 1; j++) {
23593
+ for (let j2 = 0; j2 < len - 1; j2++) {
23520
23594
  const seg = this._distanceToSegment(
23521
23595
  hoverX,
23522
23596
  hoverY,
23523
- xArr[j],
23524
- yArr[j],
23525
- xArr[j + 1],
23526
- yArr[j + 1]
23597
+ xArr[j2],
23598
+ yArr[j2],
23599
+ xArr[j2 + 1],
23600
+ yArr[j2 + 1]
23527
23601
  );
23528
23602
  if (seg.dist < closestDist) {
23529
23603
  closestDist = seg.dist;
23530
23604
  closestSeriesIndex = i2;
23531
- closestPointIndex = seg.t < 0.5 ? j : j + 1;
23605
+ closestPointIndex = seg.t < 0.5 ? j2 : j2 + 1;
23532
23606
  }
23533
23607
  }
23534
23608
  continue;
23535
23609
  }
23536
- for (let j = 0; j < len; j++) {
23537
- const xVal = xArr[j];
23610
+ for (let j2 = 0; j2 < len; j2++) {
23611
+ const xVal = xArr[j2];
23538
23612
  const distX = hoverX - xVal;
23539
- const yVal = yArr[j];
23613
+ const yVal = yArr[j2];
23540
23614
  const distY = hoverY - yVal;
23541
23615
  const dist = Math.sqrt(distX * distX + distY * distY);
23542
23616
  if (dist < closestDist) {
23543
23617
  closestDist = dist;
23544
23618
  closestSeriesIndex = i2;
23545
- closestPointIndex = j;
23619
+ closestPointIndex = j2;
23546
23620
  }
23547
23621
  }
23548
23622
  }
@@ -23604,7 +23678,7 @@ class Utils2 {
23604
23678
  * @param {number} j - the inner index of series (series[i][j])
23605
23679
  * @return {boolean}
23606
23680
  */
23607
- isXoverlap(j) {
23681
+ isXoverlap(j2) {
23608
23682
  const w = this.w;
23609
23683
  const xSameForAllSeriesJArr = [];
23610
23684
  const seriesX = w.seriesData.seriesX.filter(
@@ -23612,8 +23686,8 @@ class Utils2 {
23612
23686
  );
23613
23687
  if (seriesX.length > 0) {
23614
23688
  for (let i2 = 0; i2 < seriesX.length - 1; i2++) {
23615
- if (typeof seriesX[i2][j] !== "undefined" && typeof seriesX[i2 + 1][j] !== "undefined") {
23616
- if (seriesX[i2][j] !== seriesX[i2 + 1][j]) {
23689
+ if (typeof seriesX[i2][j2] !== "undefined" && typeof seriesX[i2 + 1][j2] !== "undefined") {
23690
+ if (seriesX[i2][j2] !== seriesX[i2 + 1][j2]) {
23617
23691
  xSameForAllSeriesJArr.push("unEqual");
23618
23692
  }
23619
23693
  }
@@ -23764,20 +23838,20 @@ class Labels {
23764
23838
  this.tooltipUtil = new Utils2(tooltipContext);
23765
23839
  }
23766
23840
  /** @param {{ shared?: boolean, ttItems?: any, i?: number, j?: any, y1?: any, y2?: any, e?: any }} opts */
23767
- drawSeriesTexts({ shared = true, ttItems, i: i2 = 0, j = null, y1, y2, e: e2 }) {
23841
+ drawSeriesTexts({ shared = true, ttItems, i: i2 = 0, j: j2 = null, y1, y2, e: e2 }) {
23768
23842
  const w = this.w;
23769
23843
  if (w.config.tooltip.custom !== void 0) {
23770
- this.handleCustomTooltip({ i: i2, j, y1, y2, w });
23844
+ this.handleCustomTooltip({ i: i2, j: j2, y1, y2, w });
23771
23845
  } else {
23772
23846
  this.toggleActiveInactiveSeries(shared, i2);
23773
23847
  }
23774
23848
  const values = this.getValuesToPrint({
23775
23849
  i: i2,
23776
- j
23850
+ j: j2
23777
23851
  });
23778
23852
  this.printLabels({
23779
23853
  i: i2,
23780
- j,
23854
+ j: j2,
23781
23855
  values,
23782
23856
  ttItems,
23783
23857
  shared,
@@ -23790,16 +23864,16 @@ class Labels {
23790
23864
  }
23791
23865
  }
23792
23866
  /** @param {{i: any, j: any, values: any, ttItems: any, shared: any, e: any}} opts */
23793
- printLabels({ i: i2, j, values, ttItems, shared, e: e2 }) {
23867
+ printLabels({ i: i2, j: j2, values, ttItems, shared, e: e2 }) {
23794
23868
  const w = this.w;
23795
23869
  const { xVal, zVal, xAxisTTVal } = values;
23796
23870
  const seriesLen = w.seriesData.series.length;
23797
- const basePColor = j !== null && w.config.plotOptions.bar.distributed ? w.globals.colors[j] : w.globals.colors[i2];
23871
+ const basePColor = j2 !== null && w.config.plotOptions.bar.distributed ? w.globals.colors[j2] : w.globals.colors[i2];
23798
23872
  for (let t2 = 0; t2 < seriesLen; t2++) {
23799
23873
  const tIndex = w.config.tooltip.inverseOrder ? seriesLen - 1 - t2 : t2;
23800
23874
  const row = this.computeSeriesRow({
23801
23875
  i: i2,
23802
- j,
23876
+ j: j2,
23803
23877
  t: t2,
23804
23878
  tIndex,
23805
23879
  shared,
@@ -23809,7 +23883,7 @@ class Labels {
23809
23883
  this.DOMHandling({
23810
23884
  i: i2,
23811
23885
  t: tIndex,
23812
- j,
23886
+ j: j2,
23813
23887
  ttItems,
23814
23888
  values: {
23815
23889
  val: row.val,
@@ -23830,7 +23904,7 @@ class Labels {
23830
23904
  * printLabels() to keep the outer loop scannable.
23831
23905
  * @param {{i: number, j: any, t: number, tIndex: number, shared: boolean, e: any, basePColor: string}} opts
23832
23906
  */
23833
- computeSeriesRow({ i: i2, j, tIndex, shared, e: e2, basePColor }) {
23907
+ computeSeriesRow({ i: i2, j: j2, tIndex, shared, e: e2, basePColor }) {
23834
23908
  const w = this.w;
23835
23909
  let f = this.getFormatters(i2);
23836
23910
  let pColor = basePColor;
@@ -23842,19 +23916,19 @@ class Labels {
23842
23916
  let seriesName = w.config.chart.type === "treemap" ? f.yLbTitleFormatter(
23843
23917
  String(
23844
23918
  /** @type {any} */
23845
- w.config.series[i2].data[j].x
23919
+ w.config.series[i2].data[j2].x
23846
23920
  ),
23847
23921
  {
23848
23922
  series: w.seriesData.series,
23849
23923
  seriesIndex: i2,
23850
- dataPointIndex: j,
23924
+ dataPointIndex: j2,
23851
23925
  w
23852
23926
  }
23853
23927
  ) : this.getSeriesName({
23854
23928
  fn: f.yLbTitleFormatter,
23855
23929
  index: i2,
23856
23930
  seriesIndex: i2,
23857
- j
23931
+ j: j2
23858
23932
  });
23859
23933
  if (w.globals.axisCharts) {
23860
23934
  if (shared) {
@@ -23863,18 +23937,18 @@ class Labels {
23863
23937
  fn: f.yLbTitleFormatter,
23864
23938
  index: tIndex,
23865
23939
  seriesIndex: i2,
23866
- j
23940
+ j: j2
23867
23941
  });
23868
23942
  pColor = w.globals.colors[tIndex];
23869
- val = this.formatYValue(f, tIndex, j);
23870
- goalVals = this.formatGoalVals(f, tIndex, j);
23943
+ val = this.formatYValue(f, tIndex, j2);
23944
+ goalVals = this.formatGoalVals(f, tIndex, j2);
23871
23945
  } else {
23872
23946
  pColor = this.resolvePatternColor(e2, pColor);
23873
- val = this.formatYValue(f, i2, j);
23874
- goalVals = this.formatGoalVals(f, i2, j);
23947
+ val = this.formatYValue(f, i2, j2);
23948
+ goalVals = this.formatGoalVals(f, i2, j2);
23875
23949
  }
23876
23950
  }
23877
- if (j === null) {
23951
+ if (j2 === null) {
23878
23952
  val = f.yLbFormatter(w.seriesData.series[i2], __spreadProps(__spreadValues({}, w), {
23879
23953
  seriesIndex: i2,
23880
23954
  dataPointIndex: i2
@@ -23889,35 +23963,35 @@ class Labels {
23889
23963
  * @param {number} index
23890
23964
  * @param {any} j
23891
23965
  */
23892
- formatYValue(f, index, j) {
23966
+ formatYValue(f, index, j2) {
23893
23967
  var _a, _b, _c, _d;
23894
23968
  const w = this.w;
23895
23969
  const steps = w.waterfallData && w.waterfallData.values;
23896
- if (steps && steps[index] && steps[index][j] != null) {
23897
- return f.yLbFormatter(steps[index][j], {
23970
+ if (steps && steps[index] && steps[index][j2] != null) {
23971
+ return f.yLbFormatter(steps[index][j2], {
23898
23972
  series: steps,
23899
23973
  seriesIndex: index,
23900
- dataPointIndex: j,
23974
+ dataPointIndex: j2,
23901
23975
  w
23902
23976
  });
23903
23977
  }
23904
23978
  if (w.axisFlags.isRangeData) {
23905
- return f.yLbFormatter((_b = (_a = w.rangeData.seriesRangeStart) == null ? void 0 : _a[index]) == null ? void 0 : _b[j], {
23979
+ return f.yLbFormatter((_b = (_a = w.rangeData.seriesRangeStart) == null ? void 0 : _a[index]) == null ? void 0 : _b[j2], {
23906
23980
  series: w.rangeData.seriesRangeStart,
23907
23981
  seriesIndex: index,
23908
- dataPointIndex: j,
23982
+ dataPointIndex: j2,
23909
23983
  w
23910
- }) + " - " + f.yLbFormatter((_d = (_c = w.rangeData.seriesRangeEnd) == null ? void 0 : _c[index]) == null ? void 0 : _d[j], {
23984
+ }) + " - " + f.yLbFormatter((_d = (_c = w.rangeData.seriesRangeEnd) == null ? void 0 : _c[index]) == null ? void 0 : _d[j2], {
23911
23985
  series: w.rangeData.seriesRangeEnd,
23912
23986
  seriesIndex: index,
23913
- dataPointIndex: j,
23987
+ dataPointIndex: j2,
23914
23988
  w
23915
23989
  });
23916
23990
  }
23917
- return f.yLbFormatter(w.seriesData.series[index][j], {
23991
+ return f.yLbFormatter(w.seriesData.series[index][j2], {
23918
23992
  series: w.seriesData.series,
23919
23993
  seriesIndex: index,
23920
- dataPointIndex: j,
23994
+ dataPointIndex: j2,
23921
23995
  w
23922
23996
  });
23923
23997
  }
@@ -23928,16 +24002,16 @@ class Labels {
23928
24002
  * @param {number} index
23929
24003
  * @param {any} j
23930
24004
  */
23931
- formatGoalVals(f, index, j) {
24005
+ formatGoalVals(f, index, j2) {
23932
24006
  var _a;
23933
24007
  const w = this.w;
23934
- const goals = (_a = w.seriesData.seriesGoals[index]) == null ? void 0 : _a[j];
24008
+ const goals = (_a = w.seriesData.seriesGoals[index]) == null ? void 0 : _a[j2];
23935
24009
  if (!Array.isArray(goals)) return [];
23936
24010
  return goals.map((goal) => ({
23937
24011
  attrs: goal,
23938
24012
  val: f.yLbFormatter(goal.value, {
23939
24013
  seriesIndex: index,
23940
- dataPointIndex: j,
24014
+ dataPointIndex: j2,
23941
24015
  w
23942
24016
  })
23943
24017
  }));
@@ -24009,17 +24083,17 @@ class Labels {
24009
24083
  };
24010
24084
  }
24011
24085
  /** @param {{fn: any, index: any, seriesIndex: any, j: any}} opts */
24012
- getSeriesName({ fn, index, seriesIndex, j }) {
24086
+ getSeriesName({ fn, index, seriesIndex, j: j2 }) {
24013
24087
  const w = this.w;
24014
24088
  return fn(String(w.seriesData.seriesNames[index]), {
24015
24089
  series: w.seriesData.series,
24016
24090
  seriesIndex,
24017
- dataPointIndex: j,
24091
+ dataPointIndex: j2,
24018
24092
  w
24019
24093
  });
24020
24094
  }
24021
24095
  /** @param {{ t?: any, j?: any, i?: any, ttItems?: any, values?: any, seriesName?: any, shared?: any, pColor?: any }} opts */
24022
- DOMHandling({ t: t2, j, ttItems, values, seriesName, shared, pColor }) {
24096
+ DOMHandling({ t: t2, j: j2, ttItems, values, seriesName, shared, pColor }) {
24023
24097
  const w = this.w;
24024
24098
  const ttCtx = this.ttCtx;
24025
24099
  const { val, goalVals, xVal, xAxisTTVal, zVal } = values;
@@ -24086,7 +24160,7 @@ class Labels {
24086
24160
  ttGVal.innerHTML = gVals + `</div>`;
24087
24161
  };
24088
24162
  if (shared) {
24089
- if (w.seriesData.seriesGoals[t2][j] && Array.isArray(w.seriesData.seriesGoals[t2][j])) {
24163
+ if (w.seriesData.seriesGoals[t2][j2] && Array.isArray(w.seriesData.seriesGoals[t2][j2])) {
24090
24164
  createGoalsHtml();
24091
24165
  } else {
24092
24166
  ttGLabel.innerHTML = "";
@@ -24158,7 +24232,7 @@ class Labels {
24158
24232
  }
24159
24233
  }
24160
24234
  /** @param {{i: any, j: any}} opts */
24161
- getValuesToPrint({ i: i2, j }) {
24235
+ getValuesToPrint({ i: i2, j: j2 }) {
24162
24236
  var _a, _b, _c, _d, _e, _f, _g, _h;
24163
24237
  const w = this.w;
24164
24238
  const filteredSeriesX = w.seriesData.seriesX.map(
@@ -24171,29 +24245,29 @@ class Labels {
24171
24245
  const customFormatterOpts = {
24172
24246
  series: w.seriesData.series,
24173
24247
  seriesIndex: i2,
24174
- dataPointIndex: j,
24248
+ dataPointIndex: j2,
24175
24249
  w
24176
24250
  };
24177
24251
  const zFormatter = w.formatters.ttZFormatter;
24178
- if (j === null) {
24252
+ if (j2 === null) {
24179
24253
  val = w.seriesData.series[i2];
24180
24254
  } else {
24181
24255
  if (w.axisFlags.isXNumeric && w.config.chart.type !== "treemap") {
24182
- xVal = filteredSeriesX[i2][j];
24256
+ xVal = filteredSeriesX[i2][j2];
24183
24257
  if (filteredSeriesX[i2].length === 0) {
24184
24258
  const firstActiveSeriesIndex = this.tooltipUtil.getFirstActiveXArray(filteredSeriesX);
24185
- xVal = filteredSeriesX[firstActiveSeriesIndex][j];
24259
+ xVal = filteredSeriesX[firstActiveSeriesIndex][j2];
24186
24260
  }
24187
24261
  } else {
24188
24262
  const dataFormat = new Data(this.w);
24189
24263
  if (dataFormat.isFormatXY()) {
24190
24264
  xVal = typeof /** @type {any} */
24191
- w.config.series[i2].data[j] !== "undefined" ? (
24265
+ w.config.series[i2].data[j2] !== "undefined" ? (
24192
24266
  /** @type {any} */
24193
- w.config.series[i2].data[j].x
24267
+ w.config.series[i2].data[j2].x
24194
24268
  ) : "";
24195
24269
  } else {
24196
- xVal = typeof w.labelData.labels[j] !== "undefined" ? w.labelData.labels[j] : "";
24270
+ xVal = typeof w.labelData.labels[j2] !== "undefined" ? w.labelData.labels[j2] : "";
24197
24271
  }
24198
24272
  }
24199
24273
  }
@@ -24222,7 +24296,7 @@ class Labels {
24222
24296
  xVal = (_f = (_e = (_d = w.formatters).ttKeyFormatter) == null ? void 0 : _e.call(_d, bufferXVal, customFormatterOpts)) != null ? _f : bufferXVal;
24223
24297
  }
24224
24298
  if (w.seriesData.seriesZ.length > 0 && w.seriesData.seriesZ[i2].length > 0) {
24225
- zVal = zFormatter == null ? void 0 : zFormatter(w.seriesData.seriesZ[i2][j], w);
24299
+ zVal = zFormatter == null ? void 0 : zFormatter(w.seriesData.seriesZ[i2][j2], w);
24226
24300
  }
24227
24301
  if (typeof w.config.xaxis.tooltip.formatter === "function") {
24228
24302
  xAxisTTVal = (_h = (_g = w.formatters).xaxisTooltipFormatter) == null ? void 0 : _h.call(
@@ -24241,7 +24315,7 @@ class Labels {
24241
24315
  };
24242
24316
  }
24243
24317
  /** @param {{i: any, j: any, y1: any, y2: any, w: any}} opts */
24244
- handleCustomTooltip({ i: i2, j, y1, y2, w }) {
24318
+ handleCustomTooltip({ i: i2, j: j2, y1, y2, w }) {
24245
24319
  const tooltipEl = this.ttCtx.getElTooltip();
24246
24320
  let fn = w.config.tooltip.custom;
24247
24321
  if (Array.isArray(fn)) {
@@ -24251,7 +24325,7 @@ class Labels {
24251
24325
  const customTooltip = fn({
24252
24326
  series: w.seriesData.series,
24253
24327
  seriesIndex: i2,
24254
- dataPointIndex: j,
24328
+ dataPointIndex: j2,
24255
24329
  y1,
24256
24330
  y2,
24257
24331
  w
@@ -24285,14 +24359,14 @@ class Position {
24285
24359
  * @param {number} cx - point's x position, wherever point's x is, you need to move crosshair
24286
24360
  * @param {number | null} [j]
24287
24361
  */
24288
- moveXCrosshairs(cx, j = null) {
24362
+ moveXCrosshairs(cx, j2 = null) {
24289
24363
  const ttCtx = this.ttCtx;
24290
24364
  const w = this.w;
24291
24365
  const xcrosshairs = ttCtx.getElXCrosshairs();
24292
24366
  let x = cx - ttCtx.xcrosshairsWidth / 2;
24293
24367
  const tickAmount = w.labelData.labels.slice().length;
24294
- if (j !== null) {
24295
- x = w.layout.gridWidth / tickAmount * j;
24368
+ if (j2 !== null) {
24369
+ x = w.layout.gridWidth / tickAmount * j2;
24296
24370
  }
24297
24371
  if (xcrosshairs !== null && !w.globals.isBarHorizontal) {
24298
24372
  xcrosshairs.setAttribute("x", String(x));
@@ -24568,7 +24642,7 @@ class Position {
24568
24642
  * @param {number} i
24569
24643
  * @param {number} j
24570
24644
  */
24571
- moveMarkers(i2, j) {
24645
+ moveMarkers(i2, j2) {
24572
24646
  var _a;
24573
24647
  const w = this.w;
24574
24648
  const ttCtx = this.ttCtx;
@@ -24577,14 +24651,14 @@ class Position {
24577
24651
  ` .apexcharts-series[data\\:realIndex='${i2}'] .apexcharts-marker`
24578
24652
  );
24579
24653
  for (let p = 0; p < allPoints.length; p++) {
24580
- if (parseInt((_a = allPoints[p].getAttribute("rel")) != null ? _a : "0", 10) === j) {
24654
+ if (parseInt((_a = allPoints[p].getAttribute("rel")) != null ? _a : "0", 10) === j2) {
24581
24655
  ttCtx.marker.resetPointsSize();
24582
- ttCtx.marker.enlargeCurrentPoint(j, allPoints[p]);
24656
+ ttCtx.marker.enlargeCurrentPoint(j2, allPoints[p]);
24583
24657
  }
24584
24658
  }
24585
24659
  } else {
24586
24660
  ttCtx.marker.resetPointsSize();
24587
- this.moveDynamicPointOnHover(j, i2);
24661
+ this.moveDynamicPointOnHover(j2, i2);
24588
24662
  }
24589
24663
  }
24590
24664
  // This function is used when you need to show markers/points only on hover -
@@ -24593,7 +24667,7 @@ class Position {
24593
24667
  * @param {number} j
24594
24668
  * @param {number} capturedSeries
24595
24669
  */
24596
- moveDynamicPointOnHover(j, capturedSeries) {
24670
+ moveDynamicPointOnHover(j2, capturedSeries) {
24597
24671
  var _a, _b, _c, _d, _e;
24598
24672
  const w = this.w;
24599
24673
  const ttCtx = this.ttCtx;
@@ -24609,8 +24683,8 @@ class Position {
24609
24683
  if (serType && (serType === "column" || serType === "candlestick" || serType === "boxPlot" || serType === "violin")) {
24610
24684
  return;
24611
24685
  }
24612
- cx = (_b = (_a = pointsArr[capturedSeries]) == null ? void 0 : _a[j]) == null ? void 0 : _b[0];
24613
- cy = ((_d = (_c = pointsArr[capturedSeries]) == null ? void 0 : _c[j]) == null ? void 0 : _d[1]) || 0;
24686
+ cx = (_b = (_a = pointsArr[capturedSeries]) == null ? void 0 : _a[j2]) == null ? void 0 : _b[0];
24687
+ cy = ((_d = (_c = pointsArr[capturedSeries]) == null ? void 0 : _c[j2]) == null ? void 0 : _d[1]) || 0;
24614
24688
  const point = w.dom.baseEl.querySelector(
24615
24689
  `.apexcharts-series[data\\:realIndex='${capturedSeries}'] .apexcharts-series-markers path`
24616
24690
  );
@@ -24629,7 +24703,7 @@ class Position {
24629
24703
  /**
24630
24704
  * @param {number} j
24631
24705
  */
24632
- moveDynamicPointsOnHover(j) {
24706
+ moveDynamicPointsOnHover(j2) {
24633
24707
  var _a, _b;
24634
24708
  const ttCtx = this.ttCtx;
24635
24709
  const w = ttCtx.w;
@@ -24646,9 +24720,9 @@ class Position {
24646
24720
  "bubble"
24647
24721
  ]);
24648
24722
  const hoverSize = ttCtx.tooltipUtil.getHoverMarkerSize(activeSeries);
24649
- if ((_a = pointsArr[activeSeries]) == null ? void 0 : _a[j]) {
24650
- cx = pointsArr[activeSeries][j][0];
24651
- cy = pointsArr[activeSeries][j][1];
24723
+ if ((_a = pointsArr[activeSeries]) == null ? void 0 : _a[j2]) {
24724
+ cx = pointsArr[activeSeries][j2][0];
24725
+ cy = pointsArr[activeSeries][j2][1];
24652
24726
  }
24653
24727
  if (isNaN(cx)) {
24654
24728
  return;
@@ -24663,12 +24737,12 @@ class Position {
24663
24737
  }
24664
24738
  }
24665
24739
  if (points[p] && pointArr && pointArr.length) {
24666
- let pcy = pointsArr[p][j][1];
24740
+ let pcy = pointsArr[p][j2][1];
24667
24741
  let pcy2;
24668
24742
  points[p].setAttribute("cx", cx);
24669
24743
  const shape = (_b = points[p].getAttribute("shape")) != null ? _b : "circle";
24670
24744
  if (w.config.chart.type === "rangeArea" && !w.globals.comboCharts) {
24671
- const rangeStartIndex = j + w.seriesData.series[p].length;
24745
+ const rangeStartIndex = j2 + w.seriesData.series[p].length;
24672
24746
  pcy2 = pointsArr[p][rangeStartIndex][1];
24673
24747
  const pcyDiff = Math.abs(pcy - pcy2) / 2;
24674
24748
  pcy = pcy - pcyDiff;
@@ -24691,7 +24765,7 @@ class Position {
24691
24765
  * @param {number} j
24692
24766
  * @param {number} capturedSeries
24693
24767
  */
24694
- moveStickyTooltipOverBars(j, capturedSeries) {
24768
+ moveStickyTooltipOverBars(j2, capturedSeries) {
24695
24769
  var _a, _b, _c, _d, _e;
24696
24770
  const w = this.w;
24697
24771
  const ttCtx = this.ttCtx;
@@ -24708,15 +24782,15 @@ class Position {
24708
24782
  i2 = series.getActiveConfigSeriesIndex("desc") + 1;
24709
24783
  }
24710
24784
  let jBar = w.dom.baseEl.querySelector(
24711
- `.apexcharts-bar-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-candlestick-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-violin-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-rangebar-series .apexcharts-series[rel='${i2}'] path[j='${j}']`
24785
+ `.apexcharts-bar-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-candlestick-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-violin-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-rangebar-series .apexcharts-series[rel='${i2}'] path[j='${j2}']`
24712
24786
  );
24713
24787
  if (!jBar && typeof capturedSeries === "number") {
24714
24788
  jBar = w.dom.baseEl.querySelector(
24715
- `.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24716
- .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24717
- .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24718
- .apexcharts-violin-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24719
- .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}']`
24789
+ `.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24790
+ .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24791
+ .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24792
+ .apexcharts-violin-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24793
+ .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}']`
24720
24794
  );
24721
24795
  }
24722
24796
  let bc = null;
@@ -24725,11 +24799,11 @@ class Position {
24725
24799
  w.globals.barCanvasCoords
24726
24800
  );
24727
24801
  if (!jBar && bcc) {
24728
- bc = typeof capturedSeries === "number" && ((_a = bcc[capturedSeries]) == null ? void 0 : _a[j]) || null;
24802
+ bc = typeof capturedSeries === "number" && ((_a = bcc[capturedSeries]) == null ? void 0 : _a[j2]) || null;
24729
24803
  if (!bc) {
24730
24804
  for (const key in bcc) {
24731
- if ((_b = bcc[key]) == null ? void 0 : _b[j]) {
24732
- bc = bcc[key][j];
24805
+ if ((_b = bcc[key]) == null ? void 0 : _b[j2]) {
24806
+ bc = bcc[key][j2];
24733
24807
  break;
24734
24808
  }
24735
24809
  }
@@ -24744,7 +24818,7 @@ class Position {
24744
24818
  const isBoxOrCandle = jBar && (jBar.classList.contains("apexcharts-candlestick-area") || jBar.classList.contains("apexcharts-boxPlot-area"));
24745
24819
  if (w.axisFlags.isXNumeric) {
24746
24820
  if (jBar && !isBoxOrCandle) {
24747
- const center = this._datapointCenterXFromBars(j);
24821
+ const center = this._datapointCenterXFromBars(j2);
24748
24822
  if (center != null) {
24749
24823
  bcx = center;
24750
24824
  } else {
@@ -24757,9 +24831,9 @@ class Position {
24757
24831
  }
24758
24832
  } else {
24759
24833
  if (!w.globals.isBarHorizontal && !bc) {
24760
- bcx = ttCtx.xAxisTicksPositions[j - 1] + ttCtx.dataPointsDividedWidth / 2;
24834
+ bcx = ttCtx.xAxisTicksPositions[j2 - 1] + ttCtx.dataPointsDividedWidth / 2;
24761
24835
  if (isNaN(bcx)) {
24762
- bcx = ttCtx.xAxisTicksPositions[j] - ttCtx.dataPointsDividedWidth / 2;
24836
+ bcx = ttCtx.xAxisTicksPositions[j2] - ttCtx.dataPointsDividedWidth / 2;
24763
24837
  }
24764
24838
  }
24765
24839
  }
@@ -24779,7 +24853,7 @@ class Position {
24779
24853
  }
24780
24854
  if (!ttCtx.fixedTooltip) {
24781
24855
  if (w.globals.isBarHorizontal && !w.config.tooltip.followCursor) {
24782
- const placed = this.placeHorizontalSharedTooltip(j);
24856
+ const placed = this.placeHorizontalSharedTooltip(j2);
24783
24857
  if (placed) return;
24784
24858
  }
24785
24859
  this.moveTooltip(bcx, bcy || w.layout.gridHeight);
@@ -24796,11 +24870,11 @@ class Position {
24796
24870
  * @param {number} j
24797
24871
  * @returns {number | null}
24798
24872
  */
24799
- _datapointCenterXFromBars(j) {
24873
+ _datapointCenterXFromBars(j2) {
24800
24874
  var _a, _b;
24801
24875
  const w = this.w;
24802
24876
  const bars = w.dom.baseEl.querySelectorAll(
24803
- `.apexcharts-bar-series path[j='${j}'],.apexcharts-rangebar-series path[j='${j}']`
24877
+ `.apexcharts-bar-series path[j='${j2}'],.apexcharts-rangebar-series path[j='${j2}']`
24804
24878
  );
24805
24879
  if (!bars.length) return null;
24806
24880
  let unionLeft = Infinity;
@@ -24829,7 +24903,7 @@ class Position {
24829
24903
  * @param {number} j
24830
24904
  * @returns {boolean}
24831
24905
  */
24832
- placeHorizontalSharedTooltip(j) {
24906
+ placeHorizontalSharedTooltip(j2) {
24833
24907
  var _a, _b;
24834
24908
  const w = this.w;
24835
24909
  const ttCtx = this.ttCtx;
@@ -24839,7 +24913,7 @@ class Position {
24839
24913
  if (!elGrid) return false;
24840
24914
  const gridRect = elGrid.getBoundingClientRect();
24841
24915
  const bars = w.dom.baseEl.querySelectorAll(
24842
- `.apexcharts-bar-series path[j='${j}'],.apexcharts-rangebar-series path[j='${j}'],.apexcharts-boxPlot-series path[j='${j}']`
24916
+ `.apexcharts-bar-series path[j='${j2}'],.apexcharts-rangebar-series path[j='${j2}'],.apexcharts-boxPlot-series path[j='${j2}']`
24843
24917
  );
24844
24918
  if (!bars.length) return false;
24845
24919
  let unionLeft = Infinity;
@@ -25008,12 +25082,12 @@ class Marker {
25008
25082
  /**
25009
25083
  * @param {number} j
25010
25084
  */
25011
- enlargePoints(j) {
25085
+ enlargePoints(j2) {
25012
25086
  var _a, _b;
25013
25087
  const w = this.w;
25014
25088
  const me = this;
25015
25089
  const ttCtx = this.ttCtx;
25016
- const col = j;
25090
+ const col = j2;
25017
25091
  const points = w.dom.baseEl.querySelectorAll(
25018
25092
  ".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"
25019
25093
  );
@@ -25128,7 +25202,7 @@ class Intersect {
25128
25202
  const renderer = w.globals.activeRenderer;
25129
25203
  const canvasCells = type === "heatmap" && renderer && renderer.kind === "canvas" && typeof renderer.hitTest === "function";
25130
25204
  const hovered = Utils2.hoverTarget(e2);
25131
- let i2, j, cx, cy, width, height;
25205
+ let i2, j2, cx, cy, width, height;
25132
25206
  if (canvasCells) {
25133
25207
  const seriesBound = opt.elGrid.getBoundingClientRect();
25134
25208
  const clientX = (_a = opt.clientX) != null ? _a : e2.type === "touchmove" ? e2.touches[0].clientX : e2.clientX;
@@ -25141,14 +25215,14 @@ class Intersect {
25141
25215
  return { x, y, noHit: true };
25142
25216
  }
25143
25217
  i2 = hit.seriesIndex;
25144
- j = hit.dataPointIndex;
25218
+ j2 = hit.dataPointIndex;
25145
25219
  cx = hit.x;
25146
25220
  cy = hit.y;
25147
25221
  width = hit.width;
25148
25222
  height = hit.height;
25149
25223
  } else if (hovered.classList.contains(`apexcharts-${type}-rect`)) {
25150
25224
  i2 = this.getAttr(e2, "i");
25151
- j = this.getAttr(e2, "j");
25225
+ j2 = this.getAttr(e2, "j");
25152
25226
  cx = this.getAttr(e2, "cx");
25153
25227
  cy = this.getAttr(e2, "cy");
25154
25228
  width = this.getAttr(e2, "width");
@@ -25159,12 +25233,12 @@ class Intersect {
25159
25233
  ttCtx.tooltipLabels.drawSeriesTexts({
25160
25234
  ttItems: opt.ttItems,
25161
25235
  i: i2,
25162
- j,
25236
+ j: j2,
25163
25237
  shared: false,
25164
25238
  e: e2
25165
25239
  });
25166
25240
  w.interact.capturedSeriesIndex = i2;
25167
- w.interact.capturedDataPointIndex = j;
25241
+ w.interact.capturedDataPointIndex = j2;
25168
25242
  ttCtx.tooltipPosition.moveXCrosshairs(cx + width / 2);
25169
25243
  const tooltipEl = ttCtx.getElTooltip();
25170
25244
  if (type === "heatmap" && w.config.tooltip.arrow && !w.config.tooltip.followCursor && tooltipEl) {
@@ -25247,12 +25321,12 @@ class Intersect {
25247
25321
  const w = this.w;
25248
25322
  const ttCtx = this.ttCtx;
25249
25323
  let i2;
25250
- let j;
25324
+ let j2;
25251
25325
  if (Utils2.hoverTarget(e2).classList.contains("apexcharts-marker")) {
25252
25326
  const cx = parseInt(opt.paths.getAttribute("cx"), 10);
25253
25327
  const cy = parseInt(opt.paths.getAttribute("cy"), 10);
25254
25328
  const val = parseFloat(opt.paths.getAttribute("val"));
25255
- j = parseInt(opt.paths.getAttribute("rel"), 10);
25329
+ j2 = parseInt(opt.paths.getAttribute("rel"), 10);
25256
25330
  i2 = parseInt(
25257
25331
  opt.paths.parentNode.parentNode.parentNode.getAttribute("rel"),
25258
25332
  10
@@ -25266,15 +25340,15 @@ class Intersect {
25266
25340
  ttCtx.tooltipLabels.drawSeriesTexts({
25267
25341
  ttItems: opt.ttItems,
25268
25342
  i: i2,
25269
- j,
25343
+ j: j2,
25270
25344
  shared: ttCtx.showOnIntersect ? false : w.config.tooltip.shared,
25271
25345
  e: e2
25272
25346
  });
25273
25347
  if (e2.type === "mouseup") {
25274
- ttCtx.markerClick(e2, i2, j);
25348
+ ttCtx.markerClick(e2, i2, j2);
25275
25349
  }
25276
25350
  w.interact.capturedSeriesIndex = i2;
25277
- w.interact.capturedDataPointIndex = j;
25351
+ w.interact.capturedDataPointIndex = j2;
25278
25352
  const arrowEnabled = !!w.config.tooltip.arrow;
25279
25353
  x = cx;
25280
25354
  if (arrowEnabled) {
@@ -25291,7 +25365,7 @@ class Intersect {
25291
25365
  const seriesBound = elGrid.getBoundingClientRect();
25292
25366
  y = ttCtx.e.clientY + w.layout.translateY - seriesBound.top;
25293
25367
  }
25294
- ttCtx.marker.enlargeCurrentPoint(j, opt.paths, x, y);
25368
+ ttCtx.marker.enlargeCurrentPoint(j2, opt.paths, x, y);
25295
25369
  }
25296
25370
  return {
25297
25371
  x,
@@ -25320,9 +25394,9 @@ class Intersect {
25320
25394
  return;
25321
25395
  }
25322
25396
  i2 = barXY.i;
25323
- const j = barXY.j;
25397
+ const j2 = barXY.j;
25324
25398
  w.interact.capturedSeriesIndex = i2;
25325
- w.interact.capturedDataPointIndex = j !== null ? j : w.interact.capturedDataPointIndex;
25399
+ w.interact.capturedDataPointIndex = j2 !== null ? j2 : w.interact.capturedDataPointIndex;
25326
25400
  if (w.globals.isBarHorizontal && ttCtx.tooltipUtil.hasBars() || !w.config.tooltip.shared) {
25327
25401
  x = barXY.x;
25328
25402
  y = barXY.y;
@@ -25438,7 +25512,7 @@ class Intersect {
25438
25512
  /** @param {{e: any, opt: any}} opts */
25439
25513
  getBarTooltipXY({ e: e2, opt }) {
25440
25514
  const w = this.w;
25441
- let j = null;
25515
+ let j2 = null;
25442
25516
  const ttCtx = this.ttCtx;
25443
25517
  let i2 = 0;
25444
25518
  let x = 0;
@@ -25477,7 +25551,7 @@ class Intersect {
25477
25551
  bottom: rectTopInGrid + bh
25478
25552
  };
25479
25553
  const clientX = e2.type === "touchmove" ? e2.touches[0].clientX : e2.clientX;
25480
- j = parseInt(bar.getAttribute("j"), 10);
25554
+ j2 = parseInt(bar.getAttribute("j"), 10);
25481
25555
  i2 = parseInt(bar.parentNode.getAttribute("rel"), 10) - 1;
25482
25556
  const y1 = bar.getAttribute("data-range-y1");
25483
25557
  const y2 = bar.getAttribute("data-range-y2");
@@ -25502,7 +25576,7 @@ class Intersect {
25502
25576
  ttCtx.tooltipLabels.drawSeriesTexts({
25503
25577
  ttItems: opt.ttItems,
25504
25578
  i: i2,
25505
- j,
25579
+ j: j2,
25506
25580
  y1: y1 ? parseInt(y1, 10) : null,
25507
25581
  y2: y2 ? parseInt(y2, 10) : null,
25508
25582
  shared: ttCtx.showOnIntersect ? false : w.config.tooltip.shared,
@@ -25535,7 +25609,7 @@ class Intersect {
25535
25609
  barHeight,
25536
25610
  barWidth,
25537
25611
  i: i2,
25538
- j,
25612
+ j: j2,
25539
25613
  // SVG attribute values — left for any caller that still wants them.
25540
25614
  barCx,
25541
25615
  barCy,
@@ -26496,9 +26570,9 @@ class Tooltip {
26496
26570
  const tooltipEl = this.getElTooltip();
26497
26571
  if (!tooltipEl) return;
26498
26572
  const i2 = parseInt(dotEl.getAttribute("i") || "0", 10);
26499
- const j = parseInt(dotEl.getAttribute("j") || "0", 10);
26573
+ const j2 = parseInt(dotEl.getAttribute("j") || "0", 10);
26500
26574
  if (typeof w.config.tooltip.custom === "function") {
26501
- this.tooltipLabels.handleCustomTooltip({ i: i2, j, y1: null, y2: null, w });
26575
+ this.tooltipLabels.handleCustomTooltip({ i: i2, j: j2, y1: null, y2: null, w });
26502
26576
  return;
26503
26577
  }
26504
26578
  const seriesName = w.seriesData.seriesNames[i2] || `series-${i2 + 1}`;
@@ -26508,7 +26582,7 @@ class Tooltip {
26508
26582
  const unitOpts = w.config.plotOptions.unit || {};
26509
26583
  const unitValue = unitOpts.unitValue > 0 ? unitOpts.unitValue : 1;
26510
26584
  const catData = w.seriesData.unitData && w.seriesData.unitData[i2];
26511
- const datum = catData ? catData[j] : void 0;
26585
+ const datum = catData ? catData[j2] : void 0;
26512
26586
  const datumObj = datum && typeof datum === "object" ? datum : null;
26513
26587
  const color = datumObj && datumObj.fillColor || w.globals.colors && w.globals.colors[i2] || "#008FFB";
26514
26588
  let body;
@@ -26517,7 +26591,7 @@ class Tooltip {
26517
26591
  body = fmt({
26518
26592
  seriesName,
26519
26593
  seriesIndex: i2,
26520
- dataPointIndex: j,
26594
+ dataPointIndex: j2,
26521
26595
  count,
26522
26596
  value,
26523
26597
  unitValue,
@@ -26528,9 +26602,9 @@ class Tooltip {
26528
26602
  } else if (datum !== void 0 && datum !== null) {
26529
26603
  const label = datumObj ? (_c = (_b = (_a = datumObj.name) != null ? _a : datumObj.label) != null ? _b : datumObj.x) != null ? _c : null : null;
26530
26604
  const dVal = datumObj ? (_e = (_d = datumObj.value) != null ? _d : datumObj.y) != null ? _e : null : datum;
26531
- body = label != null && dVal != null ? `${label}: ${dVal}` : label != null ? String(label) : dVal != null ? String(dVal) : `#${(j + 1).toLocaleString()} of ${count.toLocaleString()}`;
26605
+ body = label != null && dVal != null ? `${label}: ${dVal}` : label != null ? String(label) : dVal != null ? String(dVal) : `#${(j2 + 1).toLocaleString()} of ${count.toLocaleString()}`;
26532
26606
  } else {
26533
- body = `#${(j + 1).toLocaleString()} of ${count.toLocaleString()}`;
26607
+ body = `#${(j2 + 1).toLocaleString()} of ${count.toLocaleString()}`;
26534
26608
  if (unitValue !== 1) {
26535
26609
  body += ` &middot; ${unitValue.toLocaleString()} per dot`;
26536
26610
  }
@@ -26559,7 +26633,7 @@ class Tooltip {
26559
26633
  clientX,
26560
26634
  clientY
26561
26635
  });
26562
- const j = capj.j;
26636
+ const j2 = capj.j;
26563
26637
  let capturedSeries = capj.capturedSeries;
26564
26638
  if (capturedSeries !== null && w.globals.collapsedSeriesIndices.includes(capturedSeries != null ? capturedSeries : -1))
26565
26639
  capturedSeries = null;
@@ -26569,9 +26643,9 @@ class Tooltip {
26569
26643
  return;
26570
26644
  }
26571
26645
  if (capturedSeries !== null) {
26572
- this.handleStickyCapturedSeries(e2, capturedSeries != null ? capturedSeries : -1, opt, j != null ? j : 0);
26646
+ this.handleStickyCapturedSeries(e2, capturedSeries != null ? capturedSeries : -1, opt, j2 != null ? j2 : 0);
26573
26647
  } else {
26574
- if (this.tooltipUtil.isXoverlap(j != null ? j : 0) || w.globals.isBarHorizontal) {
26648
+ if (this.tooltipUtil.isXoverlap(j2 != null ? j2 : 0) || w.globals.isBarHorizontal) {
26575
26649
  const firstVisibleSeries = w.seriesData.series.findIndex(
26576
26650
  /**
26577
26651
  * @param {any} s
@@ -26579,7 +26653,7 @@ class Tooltip {
26579
26653
  */
26580
26654
  (s2, i2) => !w.globals.collapsedSeriesIndices.includes(i2)
26581
26655
  );
26582
- this.create(e2, this, firstVisibleSeries, j != null ? j : 0, opt.ttItems);
26656
+ this.create(e2, this, firstVisibleSeries, j2 != null ? j2 : 0, opt.ttItems);
26583
26657
  }
26584
26658
  }
26585
26659
  }
@@ -26589,23 +26663,23 @@ class Tooltip {
26589
26663
  * @param {Record<string, any>} opt
26590
26664
  * @param {number} j
26591
26665
  */
26592
- handleStickyCapturedSeries(e2, capturedSeries, opt, j) {
26666
+ handleStickyCapturedSeries(e2, capturedSeries, opt, j2) {
26593
26667
  const w = this.w;
26594
26668
  if (!this.tConfig.shared) {
26595
- const ignoreNull = w.seriesData.series[capturedSeries][j] === null;
26669
+ const ignoreNull = w.seriesData.series[capturedSeries][j2] === null;
26596
26670
  if (ignoreNull) {
26597
26671
  this.handleMouseOut(opt);
26598
26672
  return;
26599
26673
  }
26600
26674
  }
26601
- if (typeof w.seriesData.series[capturedSeries][j] !== "undefined") {
26602
- if (this.tConfig.shared && this.tooltipUtil.isXoverlap(j) && this.tooltipUtil.isInitialSeriesSameLen()) {
26603
- this.create(e2, this, capturedSeries, j, opt.ttItems);
26675
+ if (typeof w.seriesData.series[capturedSeries][j2] !== "undefined") {
26676
+ if (this.tConfig.shared && this.tooltipUtil.isXoverlap(j2) && this.tooltipUtil.isInitialSeriesSameLen()) {
26677
+ this.create(e2, this, capturedSeries, j2, opt.ttItems);
26604
26678
  } else {
26605
- this.create(e2, this, capturedSeries, j, opt.ttItems, false);
26679
+ this.create(e2, this, capturedSeries, j2, opt.ttItems, false);
26606
26680
  }
26607
26681
  } else {
26608
- if (this.tooltipUtil.isXoverlap(j)) {
26682
+ if (this.tooltipUtil.isXoverlap(j2)) {
26609
26683
  const firstVisibleSeries = w.seriesData.series.findIndex(
26610
26684
  /**
26611
26685
  * @param {any} s
@@ -26613,7 +26687,7 @@ class Tooltip {
26613
26687
  */
26614
26688
  (s2, i2) => !w.globals.collapsedSeriesIndices.includes(i2)
26615
26689
  );
26616
- this.create(e2, this, firstVisibleSeries, j, opt.ttItems);
26690
+ this.create(e2, this, firstVisibleSeries, j2, opt.ttItems);
26617
26691
  }
26618
26692
  }
26619
26693
  }
@@ -26721,12 +26795,12 @@ class Tooltip {
26721
26795
  * @param {any} ttItems
26722
26796
  * @param {boolean | null} shared
26723
26797
  */
26724
- create(e2, context, capturedSeries, j, ttItems, shared = null) {
26798
+ create(e2, context, capturedSeries, j2, ttItems, shared = null) {
26725
26799
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
26726
26800
  const w = this.w;
26727
26801
  const ttCtx = context;
26728
26802
  if (e2.type === "mouseup") {
26729
- this.markerClick(e2, capturedSeries, j);
26803
+ this.markerClick(e2, capturedSeries, j2);
26730
26804
  }
26731
26805
  if (shared === null) shared = this.tConfig.shared;
26732
26806
  const hasMarkers = this.tooltipUtil.hasMarkers(capturedSeries);
@@ -26737,9 +26811,9 @@ class Tooltip {
26737
26811
  const bars = this.tooltipUtil.getElBars();
26738
26812
  const handlePoints = () => {
26739
26813
  if (w.globals.markers.largestSize > 0 && !canvasMode && !w.globals.markers.batched) {
26740
- ttCtx.marker.enlargePoints(j);
26814
+ ttCtx.marker.enlargePoints(j2);
26741
26815
  } else {
26742
- ttCtx.tooltipPosition.moveDynamicPointsOnHover(j);
26816
+ ttCtx.tooltipPosition.moveDynamicPointsOnHover(j2);
26743
26817
  }
26744
26818
  };
26745
26819
  if (w.config.legend.tooltipHoverFormatter) {
@@ -26760,7 +26834,7 @@ class Tooltip {
26760
26834
  );
26761
26835
  const text = legendFormatter(legendName, {
26762
26836
  seriesIndex: shared ? lsIndex : capturedSeries,
26763
- dataPointIndex: j,
26837
+ dataPointIndex: j2,
26764
26838
  w
26765
26839
  });
26766
26840
  if (!shared) {
@@ -26780,11 +26854,11 @@ class Tooltip {
26780
26854
  const commonSeriesTextsParams = __spreadValues(__spreadValues({
26781
26855
  ttItems,
26782
26856
  i: capturedSeries,
26783
- j
26784
- }, ((_i = (_h = (_g = (_f = _rangeData.seriesRange) == null ? void 0 : _f[capturedSeries]) == null ? void 0 : _g[j]) == null ? void 0 : _h.y[0]) == null ? void 0 : _i.y1) !== void 0 && {
26785
- y1: (_m = (_l = (_k = (_j = _rangeData.seriesRange) == null ? void 0 : _j[capturedSeries]) == null ? void 0 : _k[j]) == null ? void 0 : _l.y[0]) == null ? void 0 : _m.y1
26786
- }), ((_q = (_p = (_o = (_n = _rangeData.seriesRange) == null ? void 0 : _n[capturedSeries]) == null ? void 0 : _o[j]) == null ? void 0 : _p.y[0]) == null ? void 0 : _q.y2) !== void 0 && {
26787
- y2: (_u = (_t = (_s = (_r = _rangeData.seriesRange) == null ? void 0 : _r[capturedSeries]) == null ? void 0 : _s[j]) == null ? void 0 : _t.y[0]) == null ? void 0 : _u.y2
26857
+ j: j2
26858
+ }, ((_i = (_h = (_g = (_f = _rangeData.seriesRange) == null ? void 0 : _f[capturedSeries]) == null ? void 0 : _g[j2]) == null ? void 0 : _h.y[0]) == null ? void 0 : _i.y1) !== void 0 && {
26859
+ y1: (_m = (_l = (_k = (_j = _rangeData.seriesRange) == null ? void 0 : _j[capturedSeries]) == null ? void 0 : _k[j2]) == null ? void 0 : _l.y[0]) == null ? void 0 : _m.y1
26860
+ }), ((_q = (_p = (_o = (_n = _rangeData.seriesRange) == null ? void 0 : _n[capturedSeries]) == null ? void 0 : _o[j2]) == null ? void 0 : _p.y[0]) == null ? void 0 : _q.y2) !== void 0 && {
26861
+ y2: (_u = (_t = (_s = (_r = _rangeData.seriesRange) == null ? void 0 : _r[capturedSeries]) == null ? void 0 : _s[j2]) == null ? void 0 : _t.y[0]) == null ? void 0 : _u.y2
26788
26862
  });
26789
26863
  if (shared) {
26790
26864
  ttCtx.tooltipLabels.drawSeriesTexts(__spreadProps(__spreadValues({}, commonSeriesTextsParams), {
@@ -26794,7 +26868,7 @@ class Tooltip {
26794
26868
  handlePoints();
26795
26869
  } else if (this.tooltipUtil.hasBars()) {
26796
26870
  if (canvasMode) {
26797
- ttCtx.tooltipPosition.moveStickyTooltipOverBars(j, capturedSeries);
26871
+ ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
26798
26872
  }
26799
26873
  this.barSeriesHeight = this.tooltipUtil.getBarsHeight(
26800
26874
  /** @type {any[]} */
@@ -26802,13 +26876,13 @@ class Tooltip {
26802
26876
  );
26803
26877
  if (this.barSeriesHeight > 0) {
26804
26878
  const graphics = new Graphics(this.w, this.ctx);
26805
- const paths = w.dom.Paper.find(`.apexcharts-bar-area[j='${j}']`);
26879
+ const paths = w.dom.Paper.find(`.apexcharts-bar-area[j='${j2}']`);
26806
26880
  this.deactivateHoverFilter();
26807
26881
  const points = ttCtx.tooltipUtil.getAllMarkers(true);
26808
26882
  if (points.length && !this.barSeriesHeight) {
26809
26883
  handlePoints();
26810
26884
  }
26811
- ttCtx.tooltipPosition.moveStickyTooltipOverBars(j, capturedSeries);
26885
+ ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
26812
26886
  for (let b = 0; b < paths.length; b++) {
26813
26887
  graphics.pathMouseEnter(
26814
26888
  /** @type {any} */
@@ -26824,12 +26898,12 @@ class Tooltip {
26824
26898
  shared: false
26825
26899
  }, commonSeriesTextsParams));
26826
26900
  if (this.tooltipUtil.hasBars()) {
26827
- ttCtx.tooltipPosition.moveStickyTooltipOverBars(j, capturedSeries);
26901
+ ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
26828
26902
  }
26829
26903
  if (hasMarkers) {
26830
- ttCtx.tooltipPosition.moveMarkers(capturedSeries, j);
26904
+ ttCtx.tooltipPosition.moveMarkers(capturedSeries, j2);
26831
26905
  } else if (dynamicPoints) {
26832
- ttCtx.tooltipPosition.moveDynamicPointOnHover(j, capturedSeries);
26906
+ ttCtx.tooltipPosition.moveDynamicPointOnHover(j2, capturedSeries);
26833
26907
  }
26834
26908
  }
26835
26909
  }
@@ -28642,14 +28716,14 @@ const l = class {
28642
28716
  const t2 = __spreadProps(__spreadValues({}, n2), { signatureVerified: true });
28643
28717
  return void (this.licenseKey === e2 ? this.publish(t2) : this.notify(t2));
28644
28718
  }
28645
- const h = "Invalid license key. The license signature does not verify.", d = { data: i2.data, expired: false, message: h, signatureVerified: true, valid: false };
28646
- this.licenseKey === e2 ? this.publish(d) : this.notify(d), t(`[Apex] ${h}`);
28719
+ const u = "Invalid license key. The license signature does not verify.", h = { data: i2.data, expired: false, message: u, signatureVerified: true, valid: false };
28720
+ this.licenseKey === e2 ? this.publish(h) : this.notify(h), t(`[Apex] ${u}`);
28647
28721
  });
28648
28722
  }
28649
28723
  };
28650
28724
  l.publicKeysSpki = ["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="], l.verdicts = /* @__PURE__ */ new Map(), l.verifying = /* @__PURE__ */ new Set(), l.warnedUnverifiable = false, l.epoch = 0;
28651
28725
  let o = l;
28652
- const A = class {
28726
+ const j = class {
28653
28727
  static applyStyles(e2) {
28654
28728
  Object.assign(e2.style, this.CRITICAL_STYLES, { backgroundImage: this.createWatermarkPattern(), backgroundRepeat: "repeat" });
28655
28729
  }
@@ -28707,8 +28781,8 @@ const A = class {
28707
28781
  })));
28708
28782
  }
28709
28783
  };
28710
- A.WATERMARK_ATTR = "data-apexcharts-watermark", A.WATERMARK_TEXT = "APEXCHARTS", A.ATTR = "data-apexcharts-watermark", A.CRITICAL_STYLES = { bottom: "0", display: "block", left: "0", msUserSelect: "none", opacity: "1", pointerEvents: "none", position: "absolute", right: "0", top: "0", userSelect: "none", visibility: "visible", webkitUserSelect: "none", zIndex: "10000" }, A.managed = /* @__PURE__ */ new Set(), A.subscribed = false;
28711
- let M = A;
28784
+ j.WATERMARK_ATTR = "data-apexcharts-watermark", j.WATERMARK_TEXT = "APEXCHARTS", j.ATTR = "data-apexcharts-watermark", j.CRITICAL_STYLES = { bottom: "0", display: "block", left: "0", msUserSelect: "none", opacity: "1", pointerEvents: "none", position: "absolute", right: "0", top: "0", userSelect: "none", visibility: "visible", webkitUserSelect: "none", zIndex: "10000" }, j.managed = /* @__PURE__ */ new Set(), j.subscribed = false;
28785
+ let C = j;
28712
28786
  const PRICING_URL = "https://apexcharts.com/pricing";
28713
28787
  let _perspectivesTokenDecoded = false;
28714
28788
  const enforced = /* @__PURE__ */ new Set();
@@ -28761,15 +28835,15 @@ function licensedForPremium(key) {
28761
28835
  return typeof plan === "string" && PREMIUM_PLANS.has(plan.toLowerCase());
28762
28836
  }
28763
28837
  function reinstateWatermark(ctx, elWrap) {
28764
- const node = M.add(elWrap, { manage: false });
28838
+ const node = C.add(elWrap, { manage: false });
28765
28839
  if (!node || typeof MutationObserver === "undefined") return;
28766
28840
  if (ctx._wmNodeObserver && ctx._wmObservedNode === node) return;
28767
28841
  if (ctx._wmNodeObserver) ctx._wmNodeObserver.disconnect();
28768
28842
  const nodeObs = new MutationObserver(() => {
28769
- const n2 = M.node(elWrap);
28843
+ const n2 = C.node(elWrap);
28770
28844
  if (!n2) return;
28771
28845
  nodeObs.disconnect();
28772
- M.applyStyles(n2);
28846
+ C.applyStyles(n2);
28773
28847
  nodeObs.takeRecords();
28774
28848
  nodeObs.observe(n2, { attributes: true, attributeFilter: ["style"] });
28775
28849
  });
@@ -28781,7 +28855,7 @@ function addWatermark(ctx, elWrap) {
28781
28855
  reinstateWatermark(ctx, elWrap);
28782
28856
  if (typeof MutationObserver === "undefined" || ctx._wmWrapObserver) return;
28783
28857
  const wrapObs = new MutationObserver(() => {
28784
- if (!M.node(elWrap)) reinstateWatermark(ctx, elWrap);
28858
+ if (!C.node(elWrap)) reinstateWatermark(ctx, elWrap);
28785
28859
  });
28786
28860
  wrapObs.observe(elWrap, { childList: true });
28787
28861
  ctx._wmWrapObserver = wrapObs;
@@ -28797,7 +28871,7 @@ function teardownWatermark(ctx, elWrap) {
28797
28871
  }
28798
28872
  ctx._wmObservedNode = null;
28799
28873
  const wrap = elWrap || ctx.w && ctx.w.dom && ctx.w.dom.elWrap;
28800
- if (wrap) M.remove(wrap, { manage: false });
28874
+ if (wrap) C.remove(wrap, { manage: false });
28801
28875
  }
28802
28876
  function notifyTrial(ctx, key, features) {
28803
28877
  if (ctx._premiumLicenseNotified) return;
@@ -29174,8 +29248,9 @@ const _ApexCharts = class _ApexCharts {
29174
29248
  /**
29175
29249
  * @param {any[]} ser
29176
29250
  * @param {object} opts
29251
+ * @param {boolean} [overwriteInitialSeries=true]
29177
29252
  */
29178
- create(ser, opts) {
29253
+ create(ser, opts, overwriteInitialSeries = true) {
29179
29254
  var _a, _b, _c, _d, _e, _f;
29180
29255
  const w = this.w;
29181
29256
  if (!this.core) {
@@ -29222,7 +29297,7 @@ const _ApexCharts = class _ApexCharts {
29222
29297
  if (Environment.isBrowser()) {
29223
29298
  this.events.setupEventHandlers();
29224
29299
  }
29225
- const parsedState = this.data.parseData(series);
29300
+ const parsedState = this.data.parseData(series, overwriteInitialSeries);
29226
29301
  this._writeParsedSeriesData(parsedState.seriesData);
29227
29302
  this._writeParsedRangeData(parsedState.rangeData);
29228
29303
  this._writeParsedCandleData(parsedState.candleData);
@@ -29289,7 +29364,7 @@ const _ApexCharts = class _ApexCharts {
29289
29364
  const me = this;
29290
29365
  const w = me.w;
29291
29366
  return new Promise((resolve, reject) => {
29292
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
29367
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
29293
29368
  if (me.el === null) {
29294
29369
  return reject(
29295
29370
  new Error("Not enough data to display or target element not found")
@@ -29387,9 +29462,11 @@ const _ApexCharts = class _ApexCharts {
29387
29462
  }
29388
29463
  if (w.config.chart.toolbar.show && !w.globals.allSeriesCollapsed) {
29389
29464
  (_k = me.toolbar) == null ? void 0 : _k.createToolbar();
29465
+ } else if (!w.globals.allSeriesCollapsed && ((_l = me.toolbar) == null ? void 0 : _l.resetControlDue())) {
29466
+ me.toolbar.createToolbar({ resetOnly: true });
29390
29467
  }
29391
29468
  }
29392
- (_l = me.weave) == null ? void 0 : _l.dispatch("draw", {
29469
+ (_m = me.weave) == null ? void 0 : _m.dispatch("draw", {
29393
29470
  pass: "full",
29394
29471
  xyRatios: graphData == null ? void 0 : graphData.xyRatios
29395
29472
  });
@@ -29578,6 +29655,7 @@ const _ApexCharts = class _ApexCharts {
29578
29655
  * @returns {Promise<ApexCharts>} Resolves with the chart instance after re-render.
29579
29656
  */
29580
29657
  appendData(newData, overwriteInitialSeries = true) {
29658
+ var _a;
29581
29659
  const me = this;
29582
29660
  me.data.resetParsingFlags();
29583
29661
  me.w.globals.dataChanged = true;
@@ -29592,14 +29670,13 @@ const _ApexCharts = class _ApexCharts {
29592
29670
  newData[i2]
29593
29671
  );
29594
29672
  if (src && Array.isArray(src.data) && Array.isArray(derivedRaw[i2].data)) {
29595
- for (let j = 0; j < src.data.length; j++) {
29596
- derivedRaw[i2].data.push(src.data[j]);
29597
- }
29673
+ derivedRaw[i2].data = derivedRaw[i2].data.concat(src.data);
29598
29674
  }
29599
29675
  }
29600
- return this.update();
29676
+ return this.update(void 0, overwriteInitialSeries);
29601
29677
  }
29602
29678
  const newSeries = me.w.config.series.slice();
29679
+ const reducerRaw = me.w.globals.dataReducerRawSeries;
29603
29680
  for (let i2 = 0; i2 < newSeries.length; i2++) {
29604
29681
  if (newData[i2] !== null && typeof newData[i2] !== "undefined") {
29605
29682
  const srcSerie = (
@@ -29610,17 +29687,15 @@ const _ApexCharts = class _ApexCharts {
29610
29687
  /** @type {any} */
29611
29688
  newSeries[i2]
29612
29689
  );
29613
- for (let j = 0; j < srcSerie.data.length; j++) {
29614
- dstSerie.data.push(srcSerie.data[j]);
29690
+ dstSerie.data = dstSerie.data.concat(srcSerie.data);
29691
+ if (reducerRaw && Array.isArray((_a = reducerRaw[i2]) == null ? void 0 : _a.data)) {
29692
+ reducerRaw[i2].data = reducerRaw[i2].data.concat(srcSerie.data);
29615
29693
  }
29616
29694
  }
29617
29695
  }
29618
29696
  trimStreamingSeries(newSeries, me.w);
29619
29697
  me.w.config.series = newSeries;
29620
- if (overwriteInitialSeries) {
29621
- me.w.globals.initialSeries = me.w.config.series;
29622
- }
29623
- return this.update();
29698
+ return this.update(void 0, overwriteInitialSeries);
29624
29699
  }
29625
29700
  /**
29626
29701
  * True when an options object carries enough series data that a
@@ -29642,15 +29717,22 @@ const _ApexCharts = class _ApexCharts {
29642
29717
  }
29643
29718
  /**
29644
29719
  * @param {object} [options]
29720
+ * @param {boolean} [overwriteInitialSeries=false] true only when the caller
29721
+ * redefined the series before triggering this re-render, so the parse it
29722
+ * runs is the one that captures the new baseline.
29645
29723
  */
29646
- update(options2) {
29724
+ update(options2, overwriteInitialSeries = false) {
29647
29725
  return new Promise((resolve, reject) => {
29648
29726
  if (options2 && this.lastUpdateOptions && !_ApexCharts._optionsTooBigToCompare(options2) && Utils$1.stringifyForCompare(this.lastUpdateOptions) === Utils$1.stringifyForCompare(options2)) {
29649
29727
  return resolve(this);
29650
29728
  }
29651
29729
  this.lastUpdateOptions = options2 && !_ApexCharts._optionsTooBigToCompare(options2) ? Utils$1.clone(options2) : null;
29652
29730
  new Destroy(this.ctx).clear({ isUpdating: true });
29653
- const graphData = this.create(this.w.config.series, options2 != null ? options2 : {});
29731
+ const graphData = this.create(
29732
+ this.w.config.series,
29733
+ options2 != null ? options2 : {},
29734
+ overwriteInitialSeries
29735
+ );
29654
29736
  if (!graphData) return resolve(this);
29655
29737
  this.mount(graphData).then(() => {
29656
29738
  var _a;