Skip to content

Commit 92dcb99

Browse files
committed
build - 3.26.2
1 parent 7162b58 commit 92dcb99

File tree

5 files changed

+50
-32
lines changed

5 files changed

+50
-32
lines changed

dist/apexcharts.amd.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apexcharts.common.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apexcharts.esm.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apexcharts.js

+37-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ApexCharts v3.26.1
2+
* ApexCharts v3.26.2
33
* (c) 2018-2021 Juned Chhipa
44
* Released under the MIT License.
55
*/
@@ -3849,6 +3849,7 @@
38493849
max: undefined,
38503850
range: undefined,
38513851
floating: false,
3852+
decimalsInFloat: undefined,
38523853
position: 'bottom',
38533854
title: {
38543855
text: undefined,
@@ -5080,7 +5081,13 @@
50805081
y = correctedLabels.y;
50815082
}
50825083

5083-
if (correctedLabels.textRects) ;
5084+
if (correctedLabels.textRects) {
5085+
// fixes #2264
5086+
if (x < -10 - correctedLabels.textRects.width || x > w.globals.gridWidth + correctedLabels.textRects.width + 10) {
5087+
// datalabels fall outside drawing area, so draw a blank label
5088+
text = '';
5089+
}
5090+
}
50845091

50855092
var dataLabelColor = w.globals.dataLabels.style.colors[i];
50865093

@@ -9655,10 +9662,6 @@
96559662

96569663
var w = this.w;
96579664

9658-
w.globals.xLabelFormatter = function (val) {
9659-
return _this.defaultGeneralFormatter(val);
9660-
};
9661-
96629665
w.globals.xaxisTooltipFormatter = function (val) {
96639666
return _this.defaultGeneralFormatter(val);
96649667
};
@@ -9681,9 +9684,18 @@
96819684
} else {
96829685
w.globals.xLabelFormatter = function (val) {
96839686
if (Utils.isNumber(val)) {
9684-
// numeric xaxis may have smaller range, so defaulting to 1 decimal
9685-
if (!w.config.xaxis.convertedCatToNumeric && w.config.xaxis.type === 'numeric' && w.globals.dataPoints < 50) {
9686-
return val.toFixed(1);
9687+
if (!w.config.xaxis.convertedCatToNumeric && w.config.xaxis.type === 'numeric') {
9688+
if (Utils.isNumber(w.config.xaxis.decimalsInFloat)) {
9689+
return val.toFixed(w.config.xaxis.decimalsInFloat);
9690+
} else {
9691+
var diff = w.globals.maxX - w.globals.minX;
9692+
9693+
if (diff > 0 && diff < 100) {
9694+
return val.toFixed(1);
9695+
}
9696+
9697+
return val.toFixed(0);
9698+
}
96879699
}
96889700

96899701
if (w.globals.isBarHorizontal) {
@@ -13583,18 +13595,15 @@
1358313595
// for timeline labels, we take the last label and check if it exceeds gridWidth
1358413596
var firstimescaleLabel = _this.dCtx.timescaleLabels[0];
1358513597
var lastTimescaleLabel = _this.dCtx.timescaleLabels[_this.dCtx.timescaleLabels.length - 1];
13586-
var lastLabelPosition = lastTimescaleLabel.position + lbWidth / 1.75 - // replace + with - ;
13587-
// allow the last label to intersect with the right y axis
13588-
_this.dCtx.yAxisWidthRight;
13589-
var firstLabelPosition = firstimescaleLabel.position - lbWidth / 1.75 + // remove conditional since the first label is always at the very left
13590-
// allow the first label to intersect with the left y axes
13591-
_this.dCtx.yAxisWidthLeft;
13592-
13593-
if (lastLabelPosition > gl.svgWidth - gl.translateX) {
13598+
var lastLabelPosition = lastTimescaleLabel.position + lbWidth / 1.75 - _this.dCtx.yAxisWidthRight;
13599+
var firstLabelPosition = firstimescaleLabel.position - lbWidth / 1.75 + _this.dCtx.yAxisWidthLeft;
13600+
var lgRightRectWidth = w.config.legend.position === 'right' && _this.dCtx.lgRect.width > 0 ? _this.dCtx.lgRect.width : 0;
13601+
13602+
if (lastLabelPosition > gl.svgWidth - gl.translateX - lgRightRectWidth) {
1359413603
gl.skipLastTimelinelabel = true;
1359513604
}
1359613605

13597-
if (firstLabelPosition < -((!yaxe.show || yaxe.floating) && (cnf.chart.type === 'bar' || cnf.chart.type === 'candlestick' || cnf.chart.type === 'rangeBar' || cnf.chart.type === 'boxPlot') ? lbWidth / 1.75 : 0)) {
13606+
if (firstLabelPosition < -((!yaxe.show || yaxe.floating) && (cnf.chart.type === 'bar' || cnf.chart.type === 'candlestick' || cnf.chart.type === 'rangeBar' || cnf.chart.type === 'boxPlot') ? lbWidth / 1.75 : 10)) {
1359813607
gl.skipFirstTimelinelabel = true;
1359913608
}
1360013609
} else if (xtype === 'datetime') {
@@ -13672,7 +13681,8 @@
1367213681

1367313682
if (!axesUtils.isYAxisHidden(index) && yaxe.labels.show && yS.result.length) {
1367413683
var lbFormatter = w.globals.yLabelFormatters[index];
13675-
var longestStr = String(yS.niceMin).length > String(yS.niceMax).length ? yS.niceMin : yS.niceMax; // the second parameter -1 is the index of tick which user can use in the formatter
13684+
var minV = yS.niceMin === Number.MIN_VALUE ? 0 : yS.niceMin;
13685+
var longestStr = String(minV).length > String(yS.niceMax).length ? minV : yS.niceMax; // the second parameter -1 is the index of tick which user can use in the formatter
1367613686

1367713687
var val = lbFormatter(longestStr, {
1367813688
seriesIndex: index,
@@ -23105,6 +23115,14 @@
2310523115
unit = 'month';
2310623116
date = firstVal.minDate;
2310723117
numberOfDays++;
23118+
} else if (firstVal.minDate !== 1 && firstVal.minHour === 0 && firstVal.minMinute === 0) {
23119+
// fixes apexcharts/apexcharts.js/issues/1730
23120+
firstTickPosition = 0;
23121+
firstTickValue = firstVal.minDate;
23122+
date = firstTickValue;
23123+
val = firstTickValue; // in case it's the last date of month, we need to check it
23124+
23125+
month = changeMonth(date, currentMonth, currentYear);
2310823126
} // push the first tick in the array
2310923127

2311023128

dist/apexcharts.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)