Skip to content

Commit 6ab6bb6

Browse files
committed
build - 3.26.3
1 parent 3cca1de commit 6ab6bb6

File tree

5 files changed

+49
-28
lines changed

5 files changed

+49
-28
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

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

dist/apexcharts.esm.js

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

dist/apexcharts.js

+39-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ApexCharts v3.26.2
2+
* ApexCharts v3.26.3
33
* (c) 2018-2021 Juned Chhipa
44
* Released under the MIT License.
55
*/
@@ -3797,6 +3797,7 @@
37973797
// internal property which should not be altered outside
37983798
offsetX: 0,
37993799
offsetY: 0,
3800+
overwriteCategories: undefined,
38003801
labels: {
38013802
show: true,
38023803
rotate: -45,
@@ -5555,12 +5556,7 @@
55555556
});
55565557
}
55575558

5558-
if (val === 0 && w.config.chart.stacked) {
5559-
// in a stacked bar/column chart, 0 value should be neglected as it will overlap on the next element
5560-
text = '';
5561-
}
5562-
5563-
var valIsNegative = w.globals.series[i][j] <= 0;
5559+
var valIsNegative = w.globals.series[i][j] < 0;
55645560
var position = w.config.plotOptions.bar.dataLabels.position;
55655561

55665562
if (w.config.plotOptions.bar.dataLabels.orientation === 'vertical') {
@@ -9980,6 +9976,16 @@
99809976
function Exports(ctx) {
99819977
_classCallCheck(this, Exports);
99829978

9979+
_defineProperty(this, "scaleSvgNode", function (svg, scale) {
9980+
// get current both width and height of the svg
9981+
var svgWidth = parseFloat(svg.getAttributeNS(null, 'width'));
9982+
var svgHeight = parseFloat(svg.getAttributeNS(null, 'height')); // set new width and height based on the scale
9983+
9984+
svg.setAttributeNS(null, 'width', svgWidth * scale);
9985+
svg.setAttributeNS(null, 'height', svgHeight * scale);
9986+
svg.setAttributeNS(null, 'viewBox', '0 0 ' + svgWidth + ' ' + svgHeight);
9987+
});
9988+
99839989
this.ctx = ctx;
99849990
this.w = ctx.w;
99859991
}
@@ -10007,8 +10013,18 @@
1000710013
}
1000810014
}, {
1000910015
key: "getSvgString",
10010-
value: function getSvgString() {
10011-
var svgString = this.w.globals.dom.Paper.svg();
10016+
value: function getSvgString(scale) {
10017+
var svgString = this.w.globals.dom.Paper.svg(); // in case the scale is different than 1, the svg needs to be rescaled
10018+
10019+
if (scale !== 1) {
10020+
// clone the svg node so it remains intact in the UI
10021+
var svgNode = this.w.globals.dom.Paper.node.cloneNode(true); // scale the image
10022+
10023+
this.scaleSvgNode(svgNode, scale); // get the string representation of the svgNode
10024+
10025+
svgString = new XMLSerializer().serializeToString(svgNode);
10026+
}
10027+
1001210028
return this.fixSvgStringForIe11(svgString);
1001310029
}
1001410030
}, {
@@ -10047,24 +10063,25 @@
1004710063
}
1004810064
}, {
1004910065
key: "dataURI",
10050-
value: function dataURI() {
10066+
value: function dataURI(options) {
1005110067
var _this = this;
1005210068

1005310069
return new Promise(function (resolve) {
1005410070
var w = _this.w;
10071+
var scale = options ? options.scale || options.width / w.globals.svgWidth : 1;
1005510072

1005610073
_this.cleanup();
1005710074

1005810075
var canvas = document.createElement('canvas');
10059-
canvas.width = w.globals.svgWidth;
10060-
canvas.height = parseInt(w.globals.dom.elWrap.style.height, 10); // because of resizeNonAxisCharts
10076+
canvas.width = w.globals.svgWidth * scale;
10077+
canvas.height = parseInt(w.globals.dom.elWrap.style.height, 10) * scale; // because of resizeNonAxisCharts
1006110078

1006210079
var canvasBg = w.config.chart.background === 'transparent' ? '#fff' : w.config.chart.background;
1006310080
var ctx = canvas.getContext('2d');
1006410081
ctx.fillStyle = canvasBg;
10065-
ctx.fillRect(0, 0, canvas.width, canvas.height);
10082+
ctx.fillRect(0, 0, canvas.width * scale, canvas.height * scale);
1006610083

10067-
var svgData = _this.getSvgString();
10084+
var svgData = _this.getSvgString(scale);
1006810085

1006910086
if (window.canvg && Utils.isIE11()) {
1007010087
// use canvg as a polyfill to workaround ie11 considering a canvas with loaded svg 'unsafe'
@@ -10309,6 +10326,10 @@
1030910326
this.xaxisLabels = w.globals.timescaleLabels.slice();
1031010327
}
1031110328

10329+
if (w.config.xaxis.overwriteCategories) {
10330+
this.xaxisLabels = w.config.xaxis.overwriteCategories;
10331+
}
10332+
1031210333
this.drawnLabels = [];
1031310334
this.drawnLabelsRects = [];
1031410335

@@ -12285,7 +12306,7 @@
1228512306
if (w.config.yaxis[realIndex].labels.show) {
1228612307
var _loop = function _loop(i) {
1228712308
var val = labels[i];
12288-
val = lbFormatter(val, i);
12309+
val = lbFormatter(val, i, w);
1228912310
var xPad = w.config.yaxis[realIndex].labels.padding;
1229012311

1229112312
if (w.config.yaxis[realIndex].opposite && w.config.yaxis.length !== 0) {
@@ -12409,7 +12430,7 @@
1240912430
if (w.config.xaxis.labels.show) {
1241012431
for (var i = tl ? 0 : tickAmount; tl ? i < tl : i >= 0; tl ? i++ : i--) {
1241112432
var val = labels[i];
12412-
val = lbFormatter(val, i);
12433+
val = lbFormatter(val, i, w);
1241312434
var x = w.globals.gridWidth + w.globals.padHorizontal - (l - labelsDivider + w.config.xaxis.labels.offsetX);
1241412435

1241512436
if (timescaleLabels.length) {
@@ -30871,9 +30892,9 @@
3087130892
}
3087230893
}, {
3087330894
key: "dataURI",
30874-
value: function dataURI() {
30895+
value: function dataURI(options) {
3087530896
var exp = new Exports(this.ctx);
30876-
return exp.dataURI();
30897+
return exp.dataURI(options);
3087730898
}
3087830899
}, {
3087930900
key: "paper",

dist/apexcharts.min.js

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

0 commit comments

Comments
 (0)