1
1
/*!
2
- * ApexCharts v3.45.1
3
- * (c) 2018-2023 ApexCharts
2
+ * ApexCharts v3.45.2
3
+ * (c) 2018-2024 ApexCharts
4
4
* Released under the MIT License.
5
5
*/
6
6
(function (global, factory) {
2418
2418
var yRatio = [];
2419
2419
var invertedYRatio = 0;
2420
2420
var xRatio = 0;
2421
- var initialXRatio = 0;
2422
2421
var invertedXRatio = 0;
2423
2422
var zRatio = 0;
2424
2423
var baseLineY = [];
2443
2442
}
2444
2443
2445
2444
xRatio = gl.xRange / gl.gridWidth;
2446
- initialXRatio = Math.abs(gl.initialMaxX - gl.initialMinX) / gl.gridWidth;
2447
2445
invertedYRatio = gl.yRange / gl.gridWidth;
2448
2446
invertedXRatio = gl.xRange / gl.gridHeight;
2449
2447
zRatio = gl.zRange / gl.gridHeight * 16;
2478
2476
invertedYRatio: invertedYRatio,
2479
2477
zRatio: zRatio,
2480
2478
xRatio: xRatio,
2481
- initialXRatio: initialXRatio,
2482
2479
invertedXRatio: invertedXRatio,
2483
2480
baseLineInvertedY: baseLineInvertedY,
2484
2481
baseLineY: baseLineY,
3712
3709
distributed: false,
3713
3710
reverseNegativeShade: false,
3714
3711
useFillColorAsStroke: false,
3712
+ borderRadius: 4,
3715
3713
dataLabels: {
3716
3714
format: 'scale' // scale | truncate
3717
3715
4186
4184
enabled: true,
4187
4185
enabledOnSeries: undefined,
4188
4186
shared: true,
4189
- hideEmptySeries: true ,
4187
+ hideEmptySeries: false ,
4190
4188
followCursor: false,
4191
4189
// when disabled, the tooltip will show on top of the series instead of mouse position
4192
4190
intersect: false,
6242
6240
var newDefaults = {};
6243
6241
6244
6242
if (opts && _typeof(opts) === 'object') {
6245
- var _opts$plotOptions, _opts$plotOptions$bar, _opts$chart$brush, _opts$plotOptions2, _opts$plotOptions2$ba, _opts, _opts$stroke, _opts $chart$sparkline, _window$Apex$chart, _window$Apex$chart$sp;
6243
+ var _opts$plotOptions, _opts$plotOptions$bar, _opts$chart$brush, _opts$plotOptions2, _opts$plotOptions2$ba, _opts$chart$sparkline, _window$Apex$chart, _window$Apex$chart$sp;
6246
6244
6247
6245
var chartDefaults = {};
6248
6246
var chartTypes = ['line', 'area', 'bar', 'candlestick', 'boxPlot', 'rangeBar', 'rangeArea', 'bubble', 'scatter', 'heatmap', 'treemap', 'pie', 'polarArea', 'donut', 'radar', 'radialBar'];
6271
6269
6272
6270
if ((_opts$plotOptions2 = opts.plotOptions) !== null && _opts$plotOptions2 !== void 0 && (_opts$plotOptions2$ba = _opts$plotOptions2.bar) !== null && _opts$plotOptions2$ba !== void 0 && _opts$plotOptions2$ba.isDumbbell) {
6273
6271
opts = defaults.dumbbell(opts);
6274
- }
6275
-
6276
- if (((_opts = opts) === null || _opts === void 0 ? void 0 : (_opts$stroke = _opts.stroke) === null || _opts$stroke === void 0 ? void 0 : _opts$stroke.curve) === 'monotoneCubic') {
6277
- opts.stroke.curve = 'smooth';
6278
6272
} // If user has specified a dark theme, make the tooltip dark too
6279
6273
6280
6274
13974
13968
stylesheet.setAttribute('nonce', nonce);
13975
13969
}
13976
13970
13977
- var text = "\t\n \t\n .apexcharts-legend {\t\n display: flex;\t\n overflow: auto;\t\n padding: 0 10px;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\t\n flex-wrap: wrap\t\n }\t\n .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\t\n flex-direction: column;\t\n bottom: 0;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\t\n justify-content: flex-start;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\t\n justify-content: center; \t\n }\t\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\t\n justify-content: flex-end;\t\n }\t\n .apexcharts-legend-series {\t\n cursor: pointer;\t\n line-height: normal;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom .apexcharts-legend-series, .apexcharts-legend.apx-legend-position-top .apexcharts-legend-series{\t\n display: flex;\t\n align-items: center;\t\n }\t\n .apexcharts-legend-text {\t\n position: relative;\t\n font-size: 14px;\t\n }\t\n .apexcharts-legend-text *, .apexcharts-legend-marker * {\t\n pointer-events: none;\t\n }\t\n .apexcharts-legend-marker {\t\n position: relative;\t\n display: inline-block;\t\n cursor: pointer;\t\n margin-right: 3px;\t\n border-style: solid;\n }\t\n \t\n .apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{\t\n display: inline-block;\t\n }\t\n .apexcharts-legend-series.apexcharts-no-click {\t\n cursor: auto;\t\n }\t\n .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\t\n display: none !important;\t\n }\t\n .apexcharts-inactive-legend {\t\n opacity: 0.45;\t\n }";
13971
+ var text = "\n .apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n }\n .apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n }\n .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n }\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n }\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n }\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n }\n .apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n }\n .apexcharts-legend.apx-legend-position-bottom .apexcharts-legend-series, .apexcharts-legend.apx-legend-position-top .apexcharts-legend-series{\n display: flex;\n align-items: center;\n }\n .apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n }\n .apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n }\n .apexcharts-legend-marker {\n position: relative;\n display: inline-block;\n cursor: pointer;\n margin-right: 3px;\n border-style: solid;\n }\n\n .apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{\n display: inline-block;\n }\n .apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n }\n .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n }\n .apexcharts-inactive-legend {\n opacity: 0.45;\n }";
13978
13972
var rules = document.createTextNode(text);
13979
13973
stylesheet.appendChild(rules);
13980
13974
return stylesheet;
19182
19176
// max barwidth should be equal to minXDiff to avoid overlap
19183
19177
var xRatio = this.barCtx.xRatio;
19184
19178
19185
- if (w.config.xaxis.convertedCatToNumeric) {
19186
- xRatio = this.barCtx.initialXRatio;
19187
- }
19188
-
19189
19179
if (w.globals.minXDiff && w.globals.minXDiff !== 0.5 && w.globals.minXDiff / xRatio > 0) {
19190
19180
xDivision = w.globals.minXDiff / xRatio;
19191
19181
}
19315
19305
var strokeWidth = 0;
19316
19306
var w = this.w;
19317
19307
19318
- if (! this.barCtx.series[i][j]) {
19308
+ if (typeof this.barCtx.series[i][j] === 'undefined' || this.barCtx.series[i][j] === null ) {
19319
19309
this.barCtx.isNullValue = true;
19320
19310
} else {
19321
19311
this.barCtx.isNullValue = false;
19707
19697
19708
19698
if (this.xyRatios !== null) {
19709
19699
this.xRatio = xyRatios.xRatio;
19710
- this.initialXRatio = xyRatios.initialXRatio;
19711
19700
this.yRatio = xyRatios.yRatio;
19712
19701
this.invertedXRatio = xyRatios.invertedXRatio;
19713
19702
this.invertedYRatio = xyRatios.invertedYRatio;
@@ -23869,28 +23858,20 @@
23869
23858
* @returns {String}
23870
23859
*/
23871
23860
23872
- var svgPath = function svgPath(points, chartWidth ) {
23861
+ var svgPath = function svgPath(points) {
23873
23862
var p = '';
23874
23863
23875
23864
for (var i = 0; i < points.length; i++) {
23876
23865
var point = points[i];
23877
- var prevPoint = points[i - 1];
23878
23866
var n = point.length;
23879
- var pn = prevPoint === null || prevPoint === void 0 ? void 0 : prevPoint.length;
23880
23867
23881
- if (i > 1 && Math.abs(point[n - 2] - prevPoint[pn - 2]) < chartWidth / 25) {
23882
- // fallback to straight line if the x distance is too small
23883
- // or if the curve goes backward too much
23884
- p += "L".concat(point[2], ", ").concat(point[3]);
23885
- } else {
23886
- if (n > 4) {
23887
- p += "C".concat(point[0], ", ").concat(point[1]);
23888
- p += ", ".concat(point[2], ", ").concat(point[3]);
23889
- p += ", ".concat(point[4], ", ").concat(point[5]);
23890
- } else if (n > 2) {
23891
- p += "S".concat(point[0], ", ").concat(point[1]);
23892
- p += ", ".concat(point[2], ", ").concat(point[3]);
23893
- }
23868
+ if (n > 4) {
23869
+ p += "C".concat(point[0], ", ").concat(point[1]);
23870
+ p += ", ".concat(point[2], ", ").concat(point[3]);
23871
+ p += ", ".concat(point[4], ", ").concat(point[5]);
23872
+ } else if (n > 2) {
23873
+ p += "S".concat(point[0], ", ").concat(point[1]);
23874
+ p += ", ".concat(point[2], ", ").concat(point[3]);
23894
23875
}
23895
23876
}
23896
23877
24046
24027
}
24047
24028
24048
24029
xArrj.push(x);
24049
- var prevX = x;
24030
+ var pX = x;
24031
+ var pY = void 0;
24032
+ var pY2 = void 0;
24033
+ var prevX = pX;
24050
24034
var prevY = this.zeroY;
24051
24035
var prevY2 = this.zeroY;
24052
24036
var lineYPosition = 0; // the first value in the current series is not null or undefined
@@ -24059,13 +24043,14 @@
24059
24043
});
24060
24044
prevY = firstPrevY.prevY;
24061
24045
24062
- if (w.config.stroke.curve === 'smooth ' && series[i][0] === null) {
24046
+ if (w.config.stroke.curve === 'monotonCubic ' && series[i][0] === null) {
24063
24047
// we have to discard the y position if 1st dataPoint is null as it causes issues with monotoneCubic path creation
24064
24048
yArrj.push(null);
24065
24049
} else {
24066
24050
yArrj.push(prevY);
24067
- } // y2 are needed for range-area charts
24051
+ }
24068
24052
24053
+ pY = prevY; // y2 are needed for range-area charts
24069
24054
24070
24055
var firstPrevY2 = void 0;
24071
24056
24077
24062
lineYPosition: lineYPosition
24078
24063
});
24079
24064
prevY2 = firstPrevY2.prevY;
24065
+ pY2 = prevY2;
24080
24066
y2Arrj.push(prevY2);
24081
24067
}
24082
24068
24097
24083
i: i,
24098
24084
x: x,
24099
24085
y: y,
24086
+ pX: pX,
24087
+ pY: pY,
24100
24088
pathsFrom: pathsFrom,
24101
24089
linePaths: linePaths,
24102
24090
areaPaths: areaPaths,
24124
24112
24125
24113
var rangePaths = this._iterateOverDataPoints(_objectSpread2(_objectSpread2({}, iteratingOpts), {}, {
24126
24114
series: seriesRangeEnd,
24115
+ pY: pY2,
24127
24116
pathsFrom: pathsFrom2,
24128
24117
iterations: seriesRangeEnd[i].length - 1,
24129
24118
isRangeStart: false
24403
24392
i = _ref3.i,
24404
24393
x = _ref3.x,
24405
24394
y = _ref3.y,
24395
+ pX = _ref3.pX,
24396
+ pY = _ref3.pY,
24406
24397
pathsFrom = _ref3.pathsFrom,
24407
24398
linePaths = _ref3.linePaths,
24408
24399
areaPaths = _ref3.areaPaths,
24517
24508
xArrj: xArrj,
24518
24509
yArrj: yArrj,
24519
24510
y2Arrj: y2Arrj,
24511
+ pX: pX,
24512
+ pY: pY,
24520
24513
linePath: linePath,
24521
24514
areaPath: areaPath,
24522
24515
linePaths: linePaths,
@@ -24527,10 +24520,12 @@
24527
24520
24528
24521
areaPaths = calculatedPaths.areaPaths;
24529
24522
linePaths = calculatedPaths.linePaths;
24523
+ pX = calculatedPaths.pX;
24524
+ pY = calculatedPaths.pY;
24530
24525
areaPath = calculatedPaths.areaPath;
24531
24526
linePath = calculatedPaths.linePath;
24532
24527
24533
- if (this.appendPathFrom && !(w.config.stroke.curve === 'smooth ' && type === 'rangeArea')) {
24528
+ if (this.appendPathFrom && !(w.config.stroke.curve === 'monotoneCubic ' && type === 'rangeArea')) {
24534
24529
pathFromLine = pathFromLine + graphics.line(x, this.zeroY);
24535
24530
pathFromArea = pathFromArea + graphics.line(x, this.zeroY);
24536
24531
}
24616
24611
yArrj = _ref5.yArrj,
24617
24612
y2 = _ref5.y2,
24618
24613
y2Arrj = _ref5.y2Arrj,
24614
+ pX = _ref5.pX,
24615
+ pY = _ref5.pY,
24619
24616
linePath = _ref5.linePath,
24620
24617
areaPath = _ref5.areaPath,
24621
24618
linePaths = _ref5.linePaths,
@@ -24635,11 +24632,11 @@
24635
24632
}
24636
24633
}
24637
24634
24638
- if (type === 'rangeArea' && (w.globals.hasNullValues || w.config.forecastDataPoints.count > 0) && curve === 'smooth ') {
24635
+ if (type === 'rangeArea' && (w.globals.hasNullValues || w.config.forecastDataPoints.count > 0) && curve === 'monotoneCubic ') {
24639
24636
curve = 'straight';
24640
24637
}
24641
24638
24642
- if (curve === 'smooth ') {
24639
+ if (curve === 'monotoneCubic ') {
24643
24640
var shouldRenderMonotone = type === 'rangeArea' ? xArrj.length === w.globals.dataPoints : j === series[i].length - 2;
24644
24641
var smoothInputs = xArrj.map(function (_, i) {
24645
24642
return [xArrj[i], yArrj[i]];
@@ -24649,14 +24646,14 @@
24649
24646
24650
24647
if (shouldRenderMonotone && smoothInputs.length > 1) {
24651
24648
var points = spline.points(smoothInputs);
24652
- linePath += svgPath(points, w.globals.gridWidth );
24649
+ linePath += svgPath(points);
24653
24650
24654
24651
if (series[i][0] === null) {
24655
24652
// if the first dataPoint is null, we use the linePath directly
24656
24653
areaPath = linePath;
24657
24654
} else {
24658
24655
// else, we append the areaPath
24659
- areaPath += svgPath(points, w.globals.gridWidth );
24656
+ areaPath += svgPath(points);
24660
24657
}
24661
24658
24662
24659
if (type === 'rangeArea' && isRangeStart) {
24668
24665
return [xArrjInversed[i], y2ArrjInversed[i]];
24669
24666
});
24670
24667
var pointsY2 = spline.points(smoothInputsY2);
24671
- linePath += svgPath(pointsY2, w.globals.gridWidth ); // in range area, we don't have separate line and area path
24668
+ linePath += svgPath(pointsY2); // in range area, we don't have separate line and area path
24672
24669
24673
24670
areaPath = linePath;
24674
24671
} else {
24678
24675
linePaths.push(linePath);
24679
24676
areaPaths.push(areaPath);
24680
24677
}
24678
+ } else if (curve === 'smooth') {
24679
+ var length = (x - pX) * 0.35;
24680
+
24681
+ if (w.globals.hasNullValues) {
24682
+ if (series[i][j] !== null) {
24683
+ if (series[i][j + 1] !== null) {
24684
+ linePath = graphics.move(pX, pY) + graphics.curve(pX + length, pY, x - length, y, x + 1, y);
24685
+ areaPath = graphics.move(pX + 1, pY) + graphics.curve(pX + length, pY, x - length, y, x + 1, y) + graphics.line(x, areaBottomY) + graphics.line(pX, areaBottomY) + 'z';
24686
+ } else {
24687
+ linePath = graphics.move(pX, pY);
24688
+ areaPath = graphics.move(pX, pY) + 'z';
24689
+ }
24690
+ }
24691
+
24692
+ linePaths.push(linePath);
24693
+ areaPaths.push(areaPath);
24694
+ } else {
24695
+ linePath = linePath + graphics.curve(pX + length, pY, x - length, y, x, y);
24696
+ areaPath = areaPath + graphics.curve(pX + length, pY, x - length, y, x, y);
24697
+ }
24698
+
24699
+ pX = x;
24700
+ pY = y;
24701
+
24702
+ if (j === series[i].length - 2) {
24703
+ // last loop, close path
24704
+ areaPath = areaPath + graphics.curve(pX, pY, x, y, x, areaBottomY) + graphics.move(x, y) + 'z';
24705
+
24706
+ if (type === 'rangeArea' && isRangeStart) {
24707
+ linePath = linePath + graphics.curve(pX, pY, x, y, x, y2) + graphics.move(x, y2) + 'z';
24708
+ } else {
24709
+ if (!w.globals.hasNullValues) {
24710
+ linePaths.push(linePath);
24711
+ areaPaths.push(areaPath);
24712
+ }
24713
+ }
24714
+ }
24681
24715
} else {
24682
24716
if (series[i][j + 1] === null) {
24683
24717
linePath = linePath + graphics.move(x, y);
24714
24748
return {
24715
24749
linePaths: linePaths,
24716
24750
areaPaths: areaPaths,
24751
+ pX: pX,
24752
+ pY: pY,
24717
24753
linePath: linePath,
24718
24754
areaPath: areaPath
24719
24755
};
25055
25091
var y1 = r[1];
25056
25092
var x2 = r[2];
25057
25093
var y2 = r[3];
25058
- var elRect = graphics.drawRect(x1, y1, x2 - x1, y2 - y1, 0 , '#fff', 1, _this.strokeWidth, w.config.plotOptions.treemap.useFillColorAsStroke ? color : w.globals.stroke.colors[i]);
25094
+ var elRect = graphics.drawRect(x1, y1, x2 - x1, y2 - y1, w.config.plotOptions.treemap.borderRadius , '#fff', 1, _this.strokeWidth, w.config.plotOptions.treemap.useFillColorAsStroke ? color : w.globals.stroke.colors[i]);
25059
25095
elRect.attr({
25060
25096
cx: x1,
25061
25097
cy: y1,
26716
26752
26717
26753
26718
26754
if (typeof w.config.chart.events.selection !== 'function') {
26719
- var targets = Array.isArray(w.config.chart.brush.targets) || [w.config.chart.brush.target]; // retro compatibility with single target option
26755
+ var targets = Array.isArray(w.config.chart.brush.targets) ? w.config.chart.brush.targets : [w.config.chart.brush.target]; // retro compatibility with single target option
26720
26756
26721
26757
targets.forEach(function (target) {
26722
26758
var targetChart = ApexCharts.getChartByID(target);
0 commit comments