apexcharts 8.0.1 → 8.2.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.
- package/README.md +14 -8
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +2310 -2274
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +1367 -1110
- package/dist/apexcharts.full.js +3880 -3531
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +3676 -3409
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +4114 -3591
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +25 -67
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +159 -163
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +125 -106
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +25 -67
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +125 -106
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +159 -163
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +2310 -2274
- package/dist/donut.common.js +2 -2
- package/dist/donut.esm.js +100 -78
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +192 -167
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +945 -640
- package/dist/features/annotations.common.js +2 -2
- package/dist/features/annotations.esm.js +46 -21
- package/dist/features/annotations.js +2 -2
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +2 -2
- package/dist/features/drilldown.esm.js +22 -2
- package/dist/features/drilldown.js +2 -2
- package/dist/features/dumbbell.common.js +2 -2
- package/dist/features/dumbbell.esm.js +34 -5
- package/dist/features/dumbbell.js +2 -2
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +203 -204
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +97 -41
- package/dist/features/highlight-filter.js +2 -2
- package/dist/features/history.common.js +2 -2
- package/dist/features/history.esm.js +4 -3
- package/dist/features/history.js +2 -2
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +20 -23
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +61 -41
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +2 -2
- package/dist/features/link.esm.js +8 -8
- package/dist/features/link.js +2 -2
- package/dist/features/marks.common.js +2 -2
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +2 -2
- package/dist/features/morph.esm.js +260 -279
- package/dist/features/morph.js +2 -2
- package/dist/features/perspectives.common.js +2 -2
- package/dist/features/perspectives.esm.js +28 -19
- package/dist/features/perspectives.js +2 -2
- package/dist/features/raincloud.common.js +2 -2
- package/dist/features/raincloud.esm.js +54 -36
- package/dist/features/raincloud.js +2 -2
- package/dist/features/renderer-canvas.common.js +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- package/dist/features/stats.common.js +2 -2
- package/dist/features/stats.esm.js +66 -18
- package/dist/features/stats.js +2 -2
- package/dist/features/storyboard.common.js +2 -2
- package/dist/features/storyboard.esm.js +24 -15
- package/dist/features/storyboard.js +2 -2
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +34 -5
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +211 -217
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +31 -19
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +2 -2
- package/dist/features/waterfall.esm.js +34 -5
- package/dist/features/waterfall.js +2 -2
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +290 -48
- package/dist/features/weave.js +2 -2
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +289 -150
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +48 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +224 -180
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +1 -1
- package/dist/icicle.js +1 -1
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +25 -67
- package/dist/line.js +2 -2
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +2 -2
- package/dist/pie.esm.js +100 -78
- package/dist/pie.js +2 -2
- package/dist/polarArea.common.js +2 -2
- package/dist/polarArea.esm.js +100 -78
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +8 -5
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +2 -2
- package/dist/radialBar.esm.js +166 -133
- package/dist/radialBar.js +2 -2
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +55 -42
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +25 -67
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +159 -163
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +25 -67
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +58 -71
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +28 -90
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +2 -2
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +2 -2
- package/dist/unit.esm.js +30 -6
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +2 -7
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +192 -167
- package/package.json +3 -1
- package/src/apexcharts.js +260 -201
- package/src/charts/Bar.js +16 -5
- package/src/charts/BarStacked.js +42 -88
- package/src/charts/BoxCandleStick.js +1 -7
- package/src/charts/HeatMap.js +73 -16
- package/src/charts/Line.js +21 -71
- package/src/charts/Pie.js +142 -89
- package/src/charts/Radar.js +4 -1
- package/src/charts/Radial.js +91 -63
- package/src/charts/RangeBar.js +1 -7
- package/src/charts/Treemap.js +25 -78
- package/src/charts/Unit.js +28 -10
- package/src/charts/Violin.js +1 -7
- package/src/charts/common/Hierarchy.js +0 -22
- package/src/charts/common/OuterLabels.js +12 -5
- package/src/charts/common/Stats.js +55 -28
- package/src/charts/common/bar/DataLabels.js +94 -83
- package/src/charts/common/bar/Helpers.js +34 -57
- package/src/charts/common/circle/Helpers.js +5 -2
- package/src/charts/common/treemap/Helpers.js +1 -1
- package/src/entries/full.js +0 -17
- package/src/features/link.js +9 -10
- package/src/features/perspectives.js +20 -19
- package/src/features/raincloud.js +51 -53
- package/src/features/stats.js +23 -35
- package/src/libs/Treemap-squared.js +7 -47
- package/src/modules/Animations.js +55 -73
- package/src/modules/Base.js +3 -2
- package/src/modules/ChartFactory.js +6 -1
- package/src/modules/Core.js +57 -30
- package/src/modules/CoreUtils.js +32 -33
- package/src/modules/Crosshairs.js +29 -11
- package/src/modules/Data.js +279 -153
- package/src/modules/DataLabels.js +18 -2
- package/src/modules/Events.js +1 -4
- package/src/modules/Exports.js +284 -305
- package/src/modules/Fill.js +23 -10
- package/src/modules/Formatters.js +14 -3
- package/src/modules/Graphics.js +8 -14
- package/src/modules/MorphPieces.js +4 -2
- package/src/modules/MorphTypeChange.js +332 -316
- package/src/modules/Range.js +56 -99
- package/src/modules/Responsive.js +186 -61
- package/src/modules/Scales.js +4 -47
- package/src/modules/Series.js +14 -45
- package/src/modules/Theme.js +108 -57
- package/src/modules/Toolbar.js +7 -13
- package/src/modules/accessibility/KeyboardNavigation.js +29 -28
- package/src/modules/animations/AxisTransition.js +54 -16
- package/src/modules/animations/CircleTransition.js +1 -4
- package/src/modules/animations/DataLabelTransition.js +15 -10
- package/src/modules/animations/StreamScroll.js +6 -4
- package/src/modules/annotations/Annotations.js +18 -17
- package/src/modules/annotations/Helpers.js +41 -17
- package/src/modules/axes/XAxis.js +4 -4
- package/src/modules/axes/YAxis.js +1 -6
- package/src/modules/dimensions/Dimensions.js +12 -7
- package/src/modules/dimensions/Grid.js +15 -3
- package/src/modules/dimensions/YAxis.js +7 -6
- package/src/modules/drilldown/Drilldown.js +22 -1
- package/src/modules/dumbbell/DumbbellData.js +3 -5
- package/src/modules/helpers/Destroy.js +10 -1
- package/src/modules/helpers/InitCtxVariables.js +19 -16
- package/src/modules/helpers/RawStash.js +51 -0
- package/src/modules/helpers/UpdateHelpers.js +95 -30
- package/src/modules/highlightFilter/HighlightFilter.js +107 -52
- package/src/modules/highlightFilter/PiePart.js +1 -1
- package/src/modules/highlightFilter/RadialPart.js +1 -1
- package/src/modules/history/History.js +7 -2
- package/src/modules/legend/Legend.js +100 -62
- package/src/modules/license/LicenseEnforcer.js +6 -1
- package/src/modules/settings/Config.js +60 -153
- package/src/modules/settings/Defaults.js +352 -58
- package/src/modules/settings/Globals.js +23 -5
- package/src/modules/settings/Options.js +19 -5
- package/src/modules/settings/TypeAliases.js +3 -6
- package/src/modules/streamgraph/StreamData.js +3 -5
- package/src/modules/tooltip/AxesTooltip.js +33 -41
- package/src/modules/tooltip/Intersect.js +50 -43
- package/src/modules/tooltip/Labels.js +62 -23
- package/src/modules/tooltip/Marker.js +6 -7
- package/src/modules/tooltip/Position.js +31 -35
- package/src/modules/tooltip/Tooltip.js +107 -119
- package/src/modules/tooltip/Utils.js +94 -159
- package/src/modules/trellis/TrellisExports.js +21 -9
- package/src/modules/trellis/TrellisTooltip.js +18 -8
- package/src/modules/waterfall/WaterfallData.js +3 -5
- package/src/modules/weave/Claims.js +14 -3
- package/src/modules/weave/Highlights.js +209 -0
- package/src/modules/weave/PluginAPI.js +64 -3
- package/src/modules/weave/WeaveHost.js +215 -51
- package/src/ssr/BrowserAPIs.js +5 -3
- package/src/ssr/DOMShim.js +6 -30
- package/src/ssr/Hydration.js +5 -36
- package/src/ssr/RenderShim.js +333 -0
- package/src/ssr/SSRRenderer.js +81 -36
- package/src/svg/SVGAnimation.js +10 -7
- package/src/types/internal.d.ts +37 -7
- package/src/utils/Constants.js +7 -8
- package/src/utils/DateTime.js +21 -195
- package/src/utils/MissingFeature.js +7 -9
- package/src/utils/Resize.js +4 -0
- package/src/utils/Utils.js +102 -171
- package/types/apexcharts.d.ts +57 -7
package/dist/waterfall.esm.js
CHANGED
|
@@ -17,8 +17,20 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
20
32
|
/*!
|
|
21
|
-
* ApexCharts v8.0
|
|
33
|
+
* ApexCharts v8.2.0
|
|
22
34
|
* (c) 2018-2026 ApexCharts
|
|
23
35
|
*/
|
|
24
36
|
import * as _core from "apexcharts/core";
|
|
@@ -127,6 +139,25 @@ class Waterfall {
|
|
|
127
139
|
}
|
|
128
140
|
}
|
|
129
141
|
const Utils = _core.__apex_Utils;
|
|
142
|
+
function collapsedIndices(gl) {
|
|
143
|
+
return (gl.collapsedSeriesIndices || []).concat(
|
|
144
|
+
gl.ancillaryCollapsedSeriesIndices || []
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function stashSeries(ser, gl) {
|
|
148
|
+
const records = (gl.collapsedSeries || []).concat(
|
|
149
|
+
gl.ancillaryCollapsedSeries || []
|
|
150
|
+
);
|
|
151
|
+
return ser.map((s, i) => {
|
|
152
|
+
const _a = s || {}, { hidden: _hidden } = _a, rest = __objRest(_a, ["hidden"]);
|
|
153
|
+
let data = rest.data;
|
|
154
|
+
if (Array.isArray(data) && !data.length) {
|
|
155
|
+
const rec = records.find((r) => r.index === i);
|
|
156
|
+
if (rec && Array.isArray(rec.data)) data = rec.data;
|
|
157
|
+
}
|
|
158
|
+
return __spreadProps(__spreadValues({}, rest), { data: Array.isArray(data) ? data.slice() : data });
|
|
159
|
+
});
|
|
160
|
+
}
|
|
130
161
|
function readDatum(d, j, categories) {
|
|
131
162
|
const fallbackX = categories && categories[j] !== void 0 ? categories[j] : j + 1;
|
|
132
163
|
if (d == null) {
|
|
@@ -223,14 +254,12 @@ function waterfallTransform(ser, w) {
|
|
|
223
254
|
const gl = w.globals;
|
|
224
255
|
if (!Array.isArray(ser)) return ser;
|
|
225
256
|
if (!gl.waterfallRawSeries) {
|
|
226
|
-
gl.waterfallRawSeries = ser
|
|
227
|
-
data: Array.isArray(s == null ? void 0 : s.data) ? s.data.slice() : s == null ? void 0 : s.data
|
|
228
|
-
}));
|
|
257
|
+
gl.waterfallRawSeries = stashSeries(ser, gl);
|
|
229
258
|
}
|
|
230
259
|
const raw = gl.waterfallRawSeries;
|
|
231
260
|
const colors = ((_b = (_a = cnf.plotOptions) == null ? void 0 : _a.waterfall) == null ? void 0 : _b.colors) || {};
|
|
232
261
|
const categories = (_c = cnf.xaxis) == null ? void 0 : _c.categories;
|
|
233
|
-
const collapsed = gl
|
|
262
|
+
const collapsed = collapsedIndices(gl);
|
|
234
263
|
const values = [];
|
|
235
264
|
const cumulative = [];
|
|
236
265
|
const kinds = [];
|
|
@@ -564,18 +593,32 @@ class BarDataLabels {
|
|
|
564
593
|
realIndex,
|
|
565
594
|
j
|
|
566
595
|
);
|
|
596
|
+
const val = (hl == null ? void 0 : hl.hide) ? void 0 : waterfallStep !== null ? waterfallStep : (
|
|
597
|
+
// only RangeBar passes a range, vertical or horizontal
|
|
598
|
+
y2 !== void 0 ? [y1, y2] : w.config.chart.stackType === "100%" ? (
|
|
599
|
+
// Read the percentages globally rather than out of `series`.
|
|
600
|
+
// Under `stackType: '100%'` BarStacked replaces `series` with
|
|
601
|
+
// the percentage rows, and in a combo chart it narrows them to
|
|
602
|
+
// just the series it draws as bars, so `series` is indexed by
|
|
603
|
+
// bar position while `realIndex` counts every series. A line
|
|
604
|
+
// ahead of a column pushed `realIndex` past the end and the
|
|
605
|
+
// label read a value off `undefined` (#2429).
|
|
606
|
+
w.globals.seriesPercent[realIndex][j]
|
|
607
|
+
) : w.seriesData.series[realIndex][j]
|
|
608
|
+
);
|
|
609
|
+
let text;
|
|
567
610
|
let textRects = {
|
|
568
611
|
width: 0,
|
|
569
612
|
height: 0
|
|
570
613
|
};
|
|
571
|
-
if (
|
|
572
|
-
|
|
614
|
+
if (dataLabelsConfig.enabled) {
|
|
615
|
+
text = val === void 0 ? "" : dataLabelsConfig.formatter(val, __spreadProps(__spreadValues({}, w), {
|
|
616
|
+
seriesIndex: realIndex,
|
|
617
|
+
dataPointIndex: j,
|
|
618
|
+
w
|
|
619
|
+
}));
|
|
573
620
|
textRects = graphics.getTextRects(
|
|
574
|
-
|
|
575
|
-
seriesIndex: realIndex,
|
|
576
|
-
dataPointIndex: j,
|
|
577
|
-
w
|
|
578
|
-
})) : w.formatters.yLabelFormatters[0](yLabel),
|
|
621
|
+
text,
|
|
579
622
|
parseFloat(dataLabelsConfig.style.fontSize).toString(),
|
|
580
623
|
dataLabelsConfig.style.fontFamily,
|
|
581
624
|
void 0,
|
|
@@ -620,19 +663,8 @@ class BarDataLabels {
|
|
|
620
663
|
x: dataLabelsPos.dataLabelsX,
|
|
621
664
|
y: dataLabelsPos.dataLabelsY,
|
|
622
665
|
neg: params.neg,
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
// its rects by data point, so a skipped one would misalign the rest.
|
|
626
|
-
val: (hl == null ? void 0 : hl.hide) ? void 0 : waterfallStep !== null ? waterfallStep : this.barCtx.isRangeBar ? [y1, y2] : w.config.chart.stackType === "100%" ? (
|
|
627
|
-
// Read the percentages globally rather than out of `series`.
|
|
628
|
-
// Under `stackType: '100%'` BarStacked replaces `series` with
|
|
629
|
-
// the percentage rows, and in a combo chart it narrows them to
|
|
630
|
-
// just the series it draws as bars, so `series` is indexed by
|
|
631
|
-
// bar position while `realIndex` counts every series. A line
|
|
632
|
-
// ahead of a column pushed `realIndex` past the end and the
|
|
633
|
-
// label read a value off `undefined` (#2429).
|
|
634
|
-
w.globals.seriesPercent[realIndex][j]
|
|
635
|
-
) : w.seriesData.series[realIndex][j],
|
|
666
|
+
val,
|
|
667
|
+
text,
|
|
636
668
|
i: realIndex,
|
|
637
669
|
j,
|
|
638
670
|
barWidth: params.barWidth,
|
|
@@ -670,16 +702,16 @@ class BarDataLabels {
|
|
|
670
702
|
return this.w.labelData.seriesGroups.length > 1;
|
|
671
703
|
}
|
|
672
704
|
/**
|
|
673
|
-
* The series group `realIndex` belongs to,
|
|
674
|
-
*
|
|
705
|
+
* The series group `realIndex` belongs to, or null when totals are
|
|
706
|
+
* chart-wide (the single-group case).
|
|
675
707
|
* @param {number} realIndex
|
|
676
|
-
* @returns {{groupIndex: number
|
|
708
|
+
* @returns {{groupIndex: number} | null}
|
|
677
709
|
*/
|
|
678
710
|
getTotalGroupContext(realIndex) {
|
|
679
711
|
if (!this.hasMultipleSeriesGroups()) return null;
|
|
680
712
|
const groupIndex = this.barCtx.barHelpers.getSeriesGroupIndex(realIndex);
|
|
681
713
|
if (groupIndex < 0) return null;
|
|
682
|
-
return { groupIndex
|
|
714
|
+
return { groupIndex };
|
|
683
715
|
}
|
|
684
716
|
/**
|
|
685
717
|
* Whether `realIndex` is the series that should draw the stacked total.
|
|
@@ -706,10 +738,23 @@ class BarDataLabels {
|
|
|
706
738
|
getStackedTotalValue({ realIndex, j }) {
|
|
707
739
|
if (this.hlt) return this.hlt.val;
|
|
708
740
|
const w = this.w;
|
|
741
|
+
const top = this.xStackTop(realIndex, j);
|
|
742
|
+
if (top) return top[3];
|
|
709
743
|
const ctx = this.getTotalGroupContext(realIndex);
|
|
710
744
|
const byGroups = w.seriesData.stackedSeriesTotalsByGroups;
|
|
711
745
|
return ctx && byGroups && byGroups[ctx.groupIndex] ? byGroups[ctx.groupIndex][j] : this.barCtx.stackedSeriesTotals[j];
|
|
712
746
|
}
|
|
747
|
+
/**
|
|
748
|
+
* The running stack at this column's x (BarStacked `tops`, columns only) on
|
|
749
|
+
* a numeric axis, where columns stack by x rather than by index.
|
|
750
|
+
* @param {number} realIndex @param {number} j
|
|
751
|
+
*/
|
|
752
|
+
xStackTop(realIndex, j) {
|
|
753
|
+
var _a, _b;
|
|
754
|
+
const w = this.w;
|
|
755
|
+
return w.axisFlags.isXNumeric && /** @type {any} */
|
|
756
|
+
((_b = (_a = this.barCtx.stacks) == null ? void 0 : _a[w.labelData.seriesGroupIndex[realIndex]]) == null ? void 0 : _b.tops.get(w.seriesData.seriesX[realIndex][j]));
|
|
757
|
+
}
|
|
713
758
|
/** @param {{realIndex: any, j: any}} opts */
|
|
714
759
|
getStackedTotalDataLabel({ realIndex, j }) {
|
|
715
760
|
const w = this.w;
|
|
@@ -829,18 +874,23 @@ class BarDataLabels {
|
|
|
829
874
|
}
|
|
830
875
|
let lowestPrevY = newY;
|
|
831
876
|
const totalGroupCtx = this.getTotalGroupContext(realIndex);
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
877
|
+
const top = this.xStackTop(realIndex, j);
|
|
878
|
+
const stacks = top ? [] : (
|
|
879
|
+
/** @type {any} */
|
|
880
|
+
this.barCtx.stacks || []
|
|
881
|
+
);
|
|
882
|
+
if (top) {
|
|
883
|
+
lowestPrevY = valIsNegative ? Math.max(newY, top[5]) : Math.min(newY, top[4]);
|
|
884
|
+
}
|
|
885
|
+
stacks.forEach((g, gi) => {
|
|
886
|
+
if (totalGroupCtx && gi !== totalGroupCtx.groupIndex) return;
|
|
887
|
+
g.prevY.forEach((arr) => {
|
|
888
|
+
if (valIsNegative) {
|
|
889
|
+
lowestPrevY = Math.max(arr[j], lowestPrevY);
|
|
890
|
+
} else {
|
|
891
|
+
lowestPrevY = Math.min(arr[j], lowestPrevY);
|
|
842
892
|
}
|
|
843
|
-
);
|
|
893
|
+
});
|
|
844
894
|
});
|
|
845
895
|
if (this.hlt) lowestPrevY = this.hlt.edge;
|
|
846
896
|
if (this.drawsStackedTotal(realIndex) && barTotalDataLabelsConfig.enabled) {
|
|
@@ -952,18 +1002,19 @@ class BarDataLabels {
|
|
|
952
1002
|
}
|
|
953
1003
|
let lowestPrevX = newX;
|
|
954
1004
|
const totalGroupCtx = this.getTotalGroupContext(realIndex);
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1005
|
+
const stacks = (
|
|
1006
|
+
/** @type {any} */
|
|
1007
|
+
this.barCtx.stacks || []
|
|
1008
|
+
);
|
|
1009
|
+
stacks.forEach((g, gi) => {
|
|
1010
|
+
if (totalGroupCtx && gi !== totalGroupCtx.groupIndex) return;
|
|
1011
|
+
g.prevX.forEach((arr) => {
|
|
1012
|
+
if (valIsNegative) {
|
|
1013
|
+
lowestPrevX = Math.min(arr[j], lowestPrevX);
|
|
1014
|
+
} else {
|
|
1015
|
+
lowestPrevX = Math.max(arr[j], lowestPrevX);
|
|
965
1016
|
}
|
|
966
|
-
);
|
|
1017
|
+
});
|
|
967
1018
|
});
|
|
968
1019
|
if (this.hlt) lowestPrevX = this.hlt.edge;
|
|
969
1020
|
if (this.drawsStackedTotal(realIndex) && barTotalDataLabelsConfig.enabled) {
|
|
@@ -1014,11 +1065,12 @@ class BarDataLabels {
|
|
|
1014
1065
|
totalDataLabelsAnchor
|
|
1015
1066
|
};
|
|
1016
1067
|
}
|
|
1017
|
-
/** @param {{x: any, y: any, val: any, neg?: boolean, i: any, j: any, textRects: any, barHeight: any, barWidth: any, dataLabelsConfig: any}} opts */
|
|
1068
|
+
/** @param {{x: any, y: any, val: any, text?: any, neg?: boolean, i: any, j: any, textRects: any, barHeight: any, barWidth: any, dataLabelsConfig: any}} opts */
|
|
1018
1069
|
drawCalculatedDataLabels({
|
|
1019
1070
|
x,
|
|
1020
1071
|
y,
|
|
1021
1072
|
val,
|
|
1073
|
+
text,
|
|
1022
1074
|
neg,
|
|
1023
1075
|
i,
|
|
1024
1076
|
// = realIndex
|
|
@@ -1041,7 +1093,10 @@ class BarDataLabels {
|
|
|
1041
1093
|
const isSeriesCollapsing = (w.globals.collapsingSeriesIndices || []).indexOf(i) > -1;
|
|
1042
1094
|
if (isSeriesCollapsing) {
|
|
1043
1095
|
const prev = (_a = w.globals.prevDataLabels) == null ? void 0 : _a.get(`${i}::${datumKey(w, i, j)}`);
|
|
1044
|
-
if (prev && isFinite(prev.val))
|
|
1096
|
+
if (prev && isFinite(prev.val)) {
|
|
1097
|
+
val = prev.val;
|
|
1098
|
+
text = void 0;
|
|
1099
|
+
}
|
|
1045
1100
|
}
|
|
1046
1101
|
if (dataLabelsConfig.enabled && (!isSeriesCollapsed || isSeriesCollapsing)) {
|
|
1047
1102
|
elDataLabelsWrap = graphics.group({
|
|
@@ -1059,8 +1114,9 @@ class BarDataLabels {
|
|
|
1059
1114
|
elDataLabelsWrap.node.setAttribute("data:dlVal", String(val));
|
|
1060
1115
|
}
|
|
1061
1116
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1117
|
+
if (val === void 0) {
|
|
1118
|
+
text = "";
|
|
1119
|
+
} else if (text === void 0) {
|
|
1064
1120
|
text = formatter(val, __spreadProps(__spreadValues({}, w), {
|
|
1065
1121
|
seriesIndex: i,
|
|
1066
1122
|
dataPointIndex: j,
|
|
@@ -1279,9 +1335,9 @@ class Helpers {
|
|
|
1279
1335
|
}
|
|
1280
1336
|
/**
|
|
1281
1337
|
* Smallest positive gap between neighbouring x values once every series is
|
|
1282
|
-
* merged onto one axis. A k-way merge over the series arrays, which
|
|
1283
|
-
*
|
|
1284
|
-
*
|
|
1338
|
+
* merged onto one axis. A k-way merge over the series arrays, which needs
|
|
1339
|
+
* each one ascending: a non-ascending array (newest-first data) is merged
|
|
1340
|
+
* from a sorted copy, or every gap would read as one huge slot.
|
|
1285
1341
|
*
|
|
1286
1342
|
* Collapsed series count too, exactly as they did for `minXDiff`. Skipping
|
|
1287
1343
|
* them would widen every bar the moment someone hid the tightest-spaced
|
|
@@ -1295,7 +1351,11 @@ class Helpers {
|
|
|
1295
1351
|
const arrays = [];
|
|
1296
1352
|
for (let i = 0; i < seriesX.length; i++) {
|
|
1297
1353
|
const xs = seriesX[i];
|
|
1298
|
-
if (Array.isArray(xs) && xs.length > 0)
|
|
1354
|
+
if (Array.isArray(xs) && xs.length > 0) {
|
|
1355
|
+
arrays.push(
|
|
1356
|
+
xs.some((v, n) => v < xs[n - 1]) ? xs.filter((v) => v === +v).sort((a, b) => a - b) : xs
|
|
1357
|
+
);
|
|
1358
|
+
}
|
|
1299
1359
|
}
|
|
1300
1360
|
if (!arrays.length) return 0;
|
|
1301
1361
|
const cursor = new Array(arrays.length).fill(0);
|
|
@@ -1407,30 +1467,27 @@ class Helpers {
|
|
|
1407
1467
|
* @param {Record<string, any>} ctx
|
|
1408
1468
|
*/
|
|
1409
1469
|
initializeStackedPrevVars(ctx) {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
});
|
|
1470
|
+
ctx.stacks = ctx.w.labelData.seriesGroups.map(() => ({
|
|
1471
|
+
prevY: [],
|
|
1472
|
+
prevX: [],
|
|
1473
|
+
prevYF: [],
|
|
1474
|
+
prevXF: [],
|
|
1475
|
+
prevYVal: [],
|
|
1476
|
+
prevXVal: [],
|
|
1477
|
+
tops: /* @__PURE__ */ new Map()
|
|
1478
|
+
}));
|
|
1420
1479
|
}
|
|
1421
1480
|
/**
|
|
1422
1481
|
* @param {Record<string, any>} ctx
|
|
1423
1482
|
*/
|
|
1424
1483
|
initializeStackedXYVars(ctx) {
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
ctx[group].yArrjF = [];
|
|
1433
|
-
ctx[group].yArrjVal = [];
|
|
1484
|
+
ctx.stacks.forEach((g) => {
|
|
1485
|
+
g.xArrj = [];
|
|
1486
|
+
g.xArrjF = [];
|
|
1487
|
+
g.xArrjVal = [];
|
|
1488
|
+
g.yArrj = [];
|
|
1489
|
+
g.yArrjF = [];
|
|
1490
|
+
g.yArrjVal = [];
|
|
1434
1491
|
});
|
|
1435
1492
|
}
|
|
1436
1493
|
/**
|
|
@@ -1756,7 +1813,7 @@ class Helpers {
|
|
|
1756
1813
|
direction
|
|
1757
1814
|
};
|
|
1758
1815
|
}
|
|
1759
|
-
/** @param {{ barWidth?: any, barXPosition?: any, y1?: any, y2?: any, yRatio?: any, strokeWidth?: any, isReversed?: any, series?: any,
|
|
1816
|
+
/** @param {{ barWidth?: any, barXPosition?: any, y1?: any, y2?: any, yRatio?: any, strokeWidth?: any, isReversed?: any, series?: any, realIndex?: any, i?: any, j?: any, w?: any }} opts */
|
|
1760
1817
|
getColumnPaths({
|
|
1761
1818
|
barWidth,
|
|
1762
1819
|
barXPosition,
|
|
@@ -1764,7 +1821,6 @@ class Helpers {
|
|
|
1764
1821
|
y2,
|
|
1765
1822
|
strokeWidth,
|
|
1766
1823
|
series,
|
|
1767
|
-
seriesGroup,
|
|
1768
1824
|
realIndex,
|
|
1769
1825
|
i,
|
|
1770
1826
|
j,
|
|
@@ -1798,8 +1854,7 @@ class Helpers {
|
|
|
1798
1854
|
pathFrom = r.base;
|
|
1799
1855
|
}
|
|
1800
1856
|
if (w.config.chart.stacked) {
|
|
1801
|
-
|
|
1802
|
-
_ctx = this.barCtx[seriesGroup];
|
|
1857
|
+
const _ctx = this.barCtx.groupCtx;
|
|
1803
1858
|
_ctx.yArrj.push(y2 - strokeCenter * direction);
|
|
1804
1859
|
_ctx.yArrjF.push(Math.abs(y1 - y2 + r.strokeWidth * direction));
|
|
1805
1860
|
_ctx.yArrjVal.push(this.barCtx.series[i][j]);
|
|
@@ -1979,7 +2034,7 @@ class Helpers {
|
|
|
1979
2034
|
barXPosition: center
|
|
1980
2035
|
};
|
|
1981
2036
|
}
|
|
1982
|
-
/** @param {{ barYPosition?: any, barHeight?: any, x1?: any, x2?: any, strokeWidth?: any, isReversed?: any, series?: any,
|
|
2037
|
+
/** @param {{ barYPosition?: any, barHeight?: any, x1?: any, x2?: any, strokeWidth?: any, isReversed?: any, series?: any, realIndex?: any, i?: any, j?: any, w?: any }} opts */
|
|
1983
2038
|
getBarpaths({
|
|
1984
2039
|
barYPosition,
|
|
1985
2040
|
barHeight,
|
|
@@ -1987,7 +2042,6 @@ class Helpers {
|
|
|
1987
2042
|
x2,
|
|
1988
2043
|
strokeWidth,
|
|
1989
2044
|
series,
|
|
1990
|
-
seriesGroup,
|
|
1991
2045
|
realIndex,
|
|
1992
2046
|
i,
|
|
1993
2047
|
j,
|
|
@@ -2026,8 +2080,7 @@ class Helpers {
|
|
|
2026
2080
|
pathFrom = graphics.move(fromX, y1) + graphics.line(fromX, y1) + slFrom + slFrom + slFrom + slFrom + slFrom + graphics.line(fromX, y1) + closing;
|
|
2027
2081
|
}
|
|
2028
2082
|
if (w.config.chart.stacked) {
|
|
2029
|
-
|
|
2030
|
-
_ctx = this.barCtx[seriesGroup];
|
|
2083
|
+
const _ctx = this.barCtx.groupCtx;
|
|
2031
2084
|
_ctx.xArrj.push(x2 + strokeCenter * direction);
|
|
2032
2085
|
_ctx.xArrjF.push(Math.abs(x1 - x2 - r.strokeWidth * direction));
|
|
2033
2086
|
_ctx.xArrjVal.push(this.barCtx.series[i][j]);
|
|
@@ -2353,24 +2406,14 @@ class Helpers {
|
|
|
2353
2406
|
* @returns {number}
|
|
2354
2407
|
*/
|
|
2355
2408
|
getSeriesGroupIndex(seriesIndex) {
|
|
2356
|
-
|
|
2357
|
-
return w.labelData.
|
|
2358
|
-
(group) => group.indexOf(w.seriesData.seriesNames[seriesIndex]) > -1
|
|
2359
|
-
);
|
|
2409
|
+
var _a;
|
|
2410
|
+
return (_a = this.w.labelData.seriesGroupIndex[seriesIndex]) != null ? _a : -1;
|
|
2360
2411
|
}
|
|
2361
2412
|
/**
|
|
2362
2413
|
* @param {number} seriesIndex
|
|
2363
2414
|
*/
|
|
2364
2415
|
getGroupIndex(seriesIndex) {
|
|
2365
|
-
const
|
|
2366
|
-
const groupIndex = w.labelData.seriesGroups.findIndex(
|
|
2367
|
-
(group) => (
|
|
2368
|
-
// w.config.series[i].name may be undefined, so use
|
|
2369
|
-
// w.seriesData.seriesNames[i], which has default names for those
|
|
2370
|
-
// series. w.labelData.seriesGroups[] uses the same default naming.
|
|
2371
|
-
group.indexOf(w.seriesData.seriesNames[seriesIndex]) > -1
|
|
2372
|
-
)
|
|
2373
|
-
);
|
|
2416
|
+
const groupIndex = this.getSeriesGroupIndex(seriesIndex);
|
|
2374
2417
|
const cGI = this.barCtx.columnGroupIndices;
|
|
2375
2418
|
let columnGroupIndex = cGI.indexOf(groupIndex);
|
|
2376
2419
|
if (columnGroupIndex < 0) {
|
|
@@ -2497,6 +2540,20 @@ class Bar {
|
|
|
2497
2540
|
);
|
|
2498
2541
|
this.barHelpers = new Helpers(this);
|
|
2499
2542
|
}
|
|
2543
|
+
/**
|
|
2544
|
+
* Point the per-series axis state at this series' y axis. Every bar-family
|
|
2545
|
+
* renderer calls it before initialPositions, which reads the baseline by
|
|
2546
|
+
* this.translationsIndex.
|
|
2547
|
+
* @param {number} realIndex
|
|
2548
|
+
* @return {number} translationsIndex
|
|
2549
|
+
*/
|
|
2550
|
+
setSeriesAxis(realIndex) {
|
|
2551
|
+
if (this.yRatio.length > 1) {
|
|
2552
|
+
this.yaxisIndex = this.w.globals.seriesYAxisReverseMap[realIndex];
|
|
2553
|
+
this.translationsIndex = realIndex;
|
|
2554
|
+
}
|
|
2555
|
+
return this.translationsIndex;
|
|
2556
|
+
}
|
|
2500
2557
|
/** primary draw method which is called on bar object
|
|
2501
2558
|
* @memberof Bar
|
|
2502
2559
|
* @param {any[]} series - user supplied series values
|
|
@@ -2542,11 +2599,7 @@ class Bar {
|
|
|
2542
2599
|
if (series[i].length > 0) {
|
|
2543
2600
|
this.visibleI = this.visibleI + 1;
|
|
2544
2601
|
}
|
|
2545
|
-
|
|
2546
|
-
this.yaxisIndex = w.globals.seriesYAxisReverseMap[realIndex];
|
|
2547
|
-
this.translationsIndex = realIndex;
|
|
2548
|
-
}
|
|
2549
|
-
const translationsIndex = this.translationsIndex;
|
|
2602
|
+
const translationsIndex = this.setSeriesAxis(realIndex);
|
|
2550
2603
|
this.isReversed = w.config.yaxis[this.yaxisIndex] && w.config.yaxis[this.yaxisIndex].reversed;
|
|
2551
2604
|
if (this.isPyramid) {
|
|
2552
2605
|
this.pyramidLayout = this.barHelpers.computePyramidLayout(series[i]);
|
|
@@ -3564,7 +3617,6 @@ class BarStacked extends Bar {
|
|
|
3564
3617
|
draw(series, seriesIndex) {
|
|
3565
3618
|
const w = this.w;
|
|
3566
3619
|
this.graphics = new Graphics(this.w);
|
|
3567
|
-
this.bar = new Bar(this.w, this.ctx, this.xyRatios);
|
|
3568
3620
|
const coreUtils = new CoreUtils(this.w);
|
|
3569
3621
|
series = coreUtils.getLogSeries(series);
|
|
3570
3622
|
this.yRatio = coreUtils.getLogYRatios(this.yRatio);
|
|
@@ -3595,18 +3647,10 @@ class BarStacked extends Bar {
|
|
|
3595
3647
|
) : i;
|
|
3596
3648
|
const { groupIndex, columnGroupIndex } = this.barHelpers.getGroupIndex(realIndex);
|
|
3597
3649
|
this.groupCtx = /** @type {any} */
|
|
3598
|
-
this[
|
|
3599
|
-
/** @type {any} */
|
|
3600
|
-
w.labelData.seriesGroups[groupIndex]
|
|
3601
|
-
];
|
|
3650
|
+
this.stacks[groupIndex];
|
|
3602
3651
|
const xArrValues = [];
|
|
3603
3652
|
const yArrValues = [];
|
|
3604
|
-
|
|
3605
|
-
if (this.yRatio.length > 1) {
|
|
3606
|
-
this.yaxisIndex = /** @type {any} */
|
|
3607
|
-
w.globals.seriesYAxisReverseMap[realIndex][0];
|
|
3608
|
-
translationsIndex = realIndex;
|
|
3609
|
-
}
|
|
3653
|
+
const translationsIndex = this.setSeriesAxis(realIndex);
|
|
3610
3654
|
this.isReversed = w.config.yaxis[this.yaxisIndex] && w.config.yaxis[this.yaxisIndex].reversed;
|
|
3611
3655
|
let elSeries = this.graphics.group({
|
|
3612
3656
|
class: `apexcharts-series`,
|
|
@@ -3670,8 +3714,7 @@ class BarStacked extends Bar {
|
|
|
3670
3714
|
x,
|
|
3671
3715
|
y,
|
|
3672
3716
|
elSeries,
|
|
3673
|
-
columnGroupIndex
|
|
3674
|
-
seriesGroup: w.labelData.seriesGroups[groupIndex]
|
|
3717
|
+
columnGroupIndex
|
|
3675
3718
|
};
|
|
3676
3719
|
let paths = (
|
|
3677
3720
|
/** @type {any} */
|
|
@@ -3862,7 +3905,7 @@ class BarStacked extends Bar {
|
|
|
3862
3905
|
zeroW
|
|
3863
3906
|
};
|
|
3864
3907
|
}
|
|
3865
|
-
/** @param {{indexes: any, barHeight: any, strokeWidth: any, zeroW: any, x: any, y: any, columnGroupIndex: any,
|
|
3908
|
+
/** @param {{indexes: any, barHeight: any, strokeWidth: any, zeroW: any, x: any, y: any, columnGroupIndex: any, yDivision: any, elSeries: any}} opts */
|
|
3866
3909
|
drawStackedBarPaths({
|
|
3867
3910
|
indexes,
|
|
3868
3911
|
barHeight,
|
|
@@ -3871,7 +3914,6 @@ class BarStacked extends Bar {
|
|
|
3871
3914
|
x,
|
|
3872
3915
|
y,
|
|
3873
3916
|
columnGroupIndex,
|
|
3874
|
-
seriesGroup,
|
|
3875
3917
|
yDivision,
|
|
3876
3918
|
elSeries
|
|
3877
3919
|
}) {
|
|
@@ -3922,7 +3964,6 @@ class BarStacked extends Bar {
|
|
|
3922
3964
|
isReversed: this.isReversed,
|
|
3923
3965
|
series: this.series,
|
|
3924
3966
|
realIndex: indexes.realIndex,
|
|
3925
|
-
seriesGroup,
|
|
3926
3967
|
i,
|
|
3927
3968
|
j,
|
|
3928
3969
|
w
|
|
@@ -3953,7 +3994,7 @@ class BarStacked extends Bar {
|
|
|
3953
3994
|
y
|
|
3954
3995
|
};
|
|
3955
3996
|
}
|
|
3956
|
-
/** @param {{indexes: any, x: any, y: any, xDivision: any, barWidth: any, zeroH: any, columnGroupIndex: any,
|
|
3997
|
+
/** @param {{indexes: any, x: any, y: any, xDivision: any, barWidth: any, zeroH: any, columnGroupIndex: any, elSeries: any}} opts */
|
|
3957
3998
|
drawStackedColumnPaths({
|
|
3958
3999
|
indexes,
|
|
3959
4000
|
x,
|
|
@@ -3962,10 +4003,9 @@ class BarStacked extends Bar {
|
|
|
3962
4003
|
barWidth,
|
|
3963
4004
|
zeroH,
|
|
3964
4005
|
columnGroupIndex,
|
|
3965
|
-
seriesGroup,
|
|
3966
4006
|
elSeries
|
|
3967
4007
|
}) {
|
|
3968
|
-
var _a, _b, _c, _d, _e, _f
|
|
4008
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3969
4009
|
const w = this.w;
|
|
3970
4010
|
const i = indexes.i;
|
|
3971
4011
|
const j = indexes.j;
|
|
@@ -3979,43 +4019,23 @@ class BarStacked extends Bar {
|
|
|
3979
4019
|
}
|
|
3980
4020
|
const barXPosition = x + columnGroupIndex * barWidth;
|
|
3981
4021
|
let barYPosition;
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
if (gsi > 0 && !w.axisFlags.isXNumeric || gsi > 0 && w.axisFlags.isXNumeric && w.seriesData.seriesX[realIndex - 1][j] === w.seriesData.seriesX[realIndex][j]) {
|
|
4022
|
+
const g = this.groupCtx;
|
|
4023
|
+
const key = w.axisFlags.isXNumeric ? w.seriesData.seriesX[realIndex][j] : j;
|
|
4024
|
+
const top = g.tops.get(key);
|
|
4025
|
+
if (top) {
|
|
4026
|
+
const [prevYValue, prevVal, prevBarH] = top;
|
|
3988
4027
|
let bYP;
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
break;
|
|
3996
|
-
}
|
|
3997
|
-
}
|
|
3998
|
-
}
|
|
3999
|
-
for (let ii = 1; ii < p; ii++) {
|
|
4000
|
-
if (((_b = this.groupCtx.prevYVal[gsi - ii]) == null ? void 0 : _b[j]) < 0) {
|
|
4001
|
-
bYP = /** @type {any} */
|
|
4002
|
-
((_c = this.series[i]) == null ? void 0 : _c[j]) >= 0 ? prevYValue - prevBarH + (this.isReversed ? prevBarH : 0) * 2 : prevYValue;
|
|
4003
|
-
break;
|
|
4004
|
-
} else if (((_d = this.groupCtx.prevYVal[gsi - ii]) == null ? void 0 : _d[j]) >= 0) {
|
|
4005
|
-
bYP = /** @type {any} */
|
|
4006
|
-
((_e = this.series[i]) == null ? void 0 : _e[j]) >= 0 ? prevYValue : prevYValue + prevBarH - (this.isReversed ? prevBarH : 0) * 2;
|
|
4007
|
-
break;
|
|
4008
|
-
}
|
|
4028
|
+
if (prevVal < 0) {
|
|
4029
|
+
bYP = /** @type {any} */
|
|
4030
|
+
((_a = this.series[i]) == null ? void 0 : _a[j]) >= 0 ? prevYValue - prevBarH + (this.isReversed ? prevBarH : 0) * 2 : prevYValue;
|
|
4031
|
+
} else if (prevVal >= 0) {
|
|
4032
|
+
bYP = /** @type {any} */
|
|
4033
|
+
((_b = this.series[i]) == null ? void 0 : _b[j]) >= 0 ? prevYValue : prevYValue + prevBarH - (this.isReversed ? prevBarH : 0) * 2;
|
|
4009
4034
|
}
|
|
4010
4035
|
if (typeof bYP === "undefined") bYP = w.layout.gridHeight;
|
|
4011
|
-
if (
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
*/
|
|
4015
|
-
((_f = this.groupCtx.prevYF[0]) == null ? void 0 : _f.every((val) => val === 0)) && this.groupCtx.prevYF.slice(1, gsi).every(
|
|
4016
|
-
(arr) => arr.every((val) => isNaN(val))
|
|
4017
|
-
)
|
|
4018
|
-
) {
|
|
4036
|
+
if (((_c = g.prevYF[0]) == null ? void 0 : _c.every((val) => val === 0)) && g.prevYF.slice(1).every(
|
|
4037
|
+
(arr) => arr.every((val) => isNaN(val))
|
|
4038
|
+
)) {
|
|
4019
4039
|
barYPosition = zeroH;
|
|
4020
4040
|
} else {
|
|
4021
4041
|
barYPosition = bYP;
|
|
@@ -4025,12 +4045,12 @@ class BarStacked extends Bar {
|
|
|
4025
4045
|
}
|
|
4026
4046
|
if (
|
|
4027
4047
|
/** @type {any} */
|
|
4028
|
-
(
|
|
4048
|
+
(_d = this.series[i]) == null ? void 0 : _d[j]
|
|
4029
4049
|
) {
|
|
4030
4050
|
y = barYPosition - /** @type {any} */
|
|
4031
|
-
((
|
|
4051
|
+
((_e = this.series[i]) == null ? void 0 : _e[j]) / this.yRatio[translationsIndex] + (this.isReversed ? (
|
|
4032
4052
|
/** @type {any} */
|
|
4033
|
-
((
|
|
4053
|
+
((_f = this.series[i]) == null ? void 0 : _f[j]) / this.yRatio[translationsIndex]
|
|
4034
4054
|
) : 0) * 2;
|
|
4035
4055
|
} else {
|
|
4036
4056
|
y = barYPosition;
|
|
@@ -4044,12 +4064,22 @@ class BarStacked extends Bar {
|
|
|
4044
4064
|
strokeWidth: this.strokeWidth,
|
|
4045
4065
|
isReversed: this.isReversed,
|
|
4046
4066
|
series: this.series,
|
|
4047
|
-
seriesGroup,
|
|
4048
4067
|
realIndex: indexes.realIndex,
|
|
4049
4068
|
i,
|
|
4050
4069
|
j,
|
|
4051
4070
|
w
|
|
4052
4071
|
});
|
|
4072
|
+
const t = g.yArrj[j];
|
|
4073
|
+
if (!isNaN(t)) {
|
|
4074
|
+
g.tops.set(key, [
|
|
4075
|
+
t,
|
|
4076
|
+
g.yArrjVal[j],
|
|
4077
|
+
(top ? top[2] : 0) + g.yArrjF[j],
|
|
4078
|
+
(top ? top[3] : 0) + (w.seriesData.series[realIndex][j] || 0),
|
|
4079
|
+
top ? Math.min(top[0], top[4]) : 1 / 0,
|
|
4080
|
+
top ? Math.max(top[0], top[5]) : -1 / 0
|
|
4081
|
+
]);
|
|
4082
|
+
}
|
|
4053
4083
|
this.barHelpers.barBackground({
|
|
4054
4084
|
bc,
|
|
4055
4085
|
j,
|
|
@@ -4110,12 +4140,7 @@ class RangeBar extends Bar {
|
|
|
4110
4140
|
if (series[i].length > 0) {
|
|
4111
4141
|
this.visibleI = this.visibleI + 1;
|
|
4112
4142
|
}
|
|
4113
|
-
|
|
4114
|
-
if (this.yRatio.length > 1) {
|
|
4115
|
-
this.yaxisIndex = /** @type {any} */
|
|
4116
|
-
w.globals.seriesYAxisReverseMap[realIndex][0];
|
|
4117
|
-
translationsIndex = realIndex;
|
|
4118
|
-
}
|
|
4143
|
+
const translationsIndex = this.setSeriesAxis(realIndex);
|
|
4119
4144
|
const initPositions = this.barHelpers.initialPositions(realIndex);
|
|
4120
4145
|
const {
|
|
4121
4146
|
y: initY,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apexcharts",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "A JavaScript Chart Library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -357,6 +357,8 @@
|
|
|
357
357
|
"unit": "vitest run tests/unit/",
|
|
358
358
|
"check:license-enforcement": "node tests/license/check-license-enforcement.mjs",
|
|
359
359
|
"check:size": "node build/check-size.mjs",
|
|
360
|
+
"cdn:pin": "node build/cdn-pin.mjs",
|
|
361
|
+
"check:cdn-pin": "node build/cdn-pin.mjs --check",
|
|
360
362
|
"e2e": "node tests/e2e/samples.js test",
|
|
361
363
|
"e2e:update": "node tests/e2e/samples.js update",
|
|
362
364
|
"e2e:ci": "node tests/e2e/samples.js test:ci",
|