Skip to content

Commit

Permalink
stacked line charts regression - fix #4132
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Dec 5, 2023
1 parent 630f9cb commit 774c7f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
8 changes: 5 additions & 3 deletions src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,11 @@ class Line {
let y2 = y

let stackSeries =
w.config.chart.stacked &&
(!this.w.config.chart.stackOnlyBar ||
this.w.config.series[realIndex]?.type === 'bar')
(w.config.chart.stacked && !w.globals.comboCharts) ||
(w.config.chart.stacked &&
w.globals.comboCharts &&
(!this.w.config.chart.stackOnlyBar ||
this.w.config.series[realIndex]?.type === 'bar'))

for (let j = 0; j < iterations; j++) {
const isNull =
Expand Down
7 changes: 5 additions & 2 deletions src/charts/common/line/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ export default class Helpers {
determineFirstPrevY({ i, series, prevY, lineYPosition }) {
let w = this.w
let stackSeries =
w.config.chart.stacked &&
(!w.config.chart.stackOnlyBar || series?.[i]?.type === 'bar')
(w.config.chart.stacked && !w.globals.comboCharts) ||
(w.config.chart.stacked &&
w.globals.comboCharts &&
(!this.w.config.chart.stackOnlyBar ||
this.w.config.series[i]?.type === 'bar'))

if (typeof series[i]?.[0] !== 'undefined') {
if (stackSeries) {
Expand Down
9 changes: 1 addition & 8 deletions src/modules/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,14 +454,7 @@ export default class Data {
ser[i].type === 'rangeArea'
) {
gl.isRangeData = true
if (gl.isComboCharts) {
if (ser[i].type === 'rangeBar' || ser[i].type === 'rangeArea') {
this.handleRangeData(ser, i)
}
} else if (
cnf.chart.type === 'rangeBar' ||
cnf.chart.type === 'rangeArea'
) {
if (cnf.chart.type === 'rangeBar' || cnf.chart.type === 'rangeArea') {
this.handleRangeData(ser, i)
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/modules/Range.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,13 @@ class Range {
stackedPoss[group][j] = 0
stackedNegs[group][j] = 0
}

let stackSeries =
!this.w.config.chart.stackOnlyBar ||
gl.series?.[i]?.type === 'bar' ||
this.w.config.chart.type === 'bar'
(this.w.config.chart.stacked && !gl.comboCharts) ||
(this.w.config.chart.stacked &&
gl.comboCharts &&
(!this.w.config.chart.stackOnlyBar ||
this.w.config.series?.[i]?.type === 'bar'))

if (stackSeries) {
if (gl.series[i][j] !== null && Utils.isNumber(gl.series[i][j])) {
Expand Down

0 comments on commit 774c7f6

Please sign in to comment.