diff --git a/src/charts/BarStacked.js b/src/charts/BarStacked.js index 2afb7eb75..2b55a4946 100644 --- a/src/charts/BarStacked.js +++ b/src/charts/BarStacked.js @@ -518,14 +518,12 @@ class BarStacked extends Bar { elSeries, }) - x = x + xDivision - return { pathTo: paths.pathTo, pathFrom: paths.pathFrom, goalY: this.barHelpers.getGoalValues('y', null, zeroH, i, j), barXPosition, - x: w.globals.isXNumeric ? x - xDivision : x, + x: w.globals.isXNumeric ? x : x + xDivision, y, } } diff --git a/src/charts/Line.js b/src/charts/Line.js index 7734b80ed..67cd3bd75 100644 --- a/src/charts/Line.js +++ b/src/charts/Line.js @@ -209,7 +209,7 @@ class Line { paths.linePaths.splice(segments) paths.pathFromLine = rangePaths.pathFromLine + paths.pathFromLine } else { - paths.pathFromArea += graphics.line(0, this.zeroY) + paths.pathFromArea += 'z' } this._handlePaths({ type, realIndex, i, paths }) @@ -964,6 +964,7 @@ class Line { + 'z' linePaths.push(linePath) areaPaths.push(areaPath) + pathState = -1 } else { let p = graphics.curve(pX + length, pY, x - length, y, x, y) linePath += p @@ -981,6 +982,7 @@ class Line { + 'z' linePaths.push(linePath) areaPaths.push(areaPath) + pathState = -1 } } break @@ -1047,6 +1049,7 @@ class Line { + 'z' linePaths.push(linePath) areaPaths.push(areaPath) + pathState = -1 } else { let p = pathToPoint(curve, x, y) linePath += p @@ -1062,6 +1065,7 @@ class Line { + 'z' linePaths.push(linePath) areaPaths.push(areaPath) + pathState = -1 } } break @@ -1109,4 +1113,4 @@ class Line { } } -export default Line +export default Line \ No newline at end of file diff --git a/src/charts/common/bar/DataLabels.js b/src/charts/common/bar/DataLabels.js index d07b32972..03f2b6ced 100644 --- a/src/charts/common/bar/DataLabels.js +++ b/src/charts/common/bar/DataLabels.js @@ -328,16 +328,14 @@ export default class BarDataLabels { ADDITIONAL_OFFY } + // width divided into equal parts + let xDivision = w.globals.gridWidth / w.globals.dataPoints + totalDataLabelsX = - totalDataLabelsBcx + - (w.globals.isXNumeric - ? barWidth * (w.globals.barGroups.length - 1) - barWidth / 2 - : -( - barWidth * w.globals.barGroups.length - - barWidth / 2 - - strokeWidth * 2 - )) + - barTotalDataLabelsConfig.offsetX + totalDataLabelsBcx + + barWidth * (w.globals.barGroups.length - 0.5) + - (w.globals.isXNumeric ? barWidth : xDivision) + + barTotalDataLabelsConfig.offsetX } if (!w.config.chart.stacked) {