Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed May 27, 2024
2 parents 153b1ba + af06d89 commit 52977aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 1 addition & 3 deletions src/charts/BarStacked.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down Expand Up @@ -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
Expand All @@ -981,6 +982,7 @@ class Line {
+ 'z'
linePaths.push(linePath)
areaPaths.push(areaPath)
pathState = -1
}
}
break
Expand Down Expand Up @@ -1047,6 +1049,7 @@ class Line {
+ 'z'
linePaths.push(linePath)
areaPaths.push(areaPath)
pathState = -1
} else {
let p = pathToPoint(curve, x, y)
linePath += p
Expand All @@ -1062,6 +1065,7 @@ class Line {
+ 'z'
linePaths.push(linePath)
areaPaths.push(areaPath)
pathState = -1
}
}
break
Expand Down Expand Up @@ -1109,4 +1113,4 @@ class Line {
}
}

export default Line
export default Line
16 changes: 7 additions & 9 deletions src/charts/common/bar/DataLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 52977aa

Please sign in to comment.