Skip to content

Commit

Permalink
tooltip bug; fixes #2879
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Jan 11, 2022
1 parent 933e316 commit d4619e1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/modules/tooltip/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default class Utils {
let j = -1

if (w.globals.series.length > 1) {
activeIndex = this.getFirstActiveXArray(Xarrays, Yarrays)
activeIndex = this.getFirstActiveXArray(Xarrays)
} else {
currIndex = 0
}
Expand Down Expand Up @@ -178,15 +178,20 @@ export default class Utils {
}
}

getFirstActiveXArray(Xarrays, Yarrays) {
getFirstActiveXArray(Xarrays) {
const w = this.w
let activeIndex = 0

let firstActiveSeriesIndex = Xarrays.map((xarr, index) => {
return xarr.length > 0 && Yarrays[index].length > 0 ? index : -1
return xarr.length > 0 ? index : -1
})

for (let a = 0; a < firstActiveSeriesIndex.length; a++) {
if (firstActiveSeriesIndex[a] !== -1) {
if (
firstActiveSeriesIndex[a] !== -1 &&
w.globals.collapsedSeriesIndices.indexOf(a) === -1 &&
w.globals.ancillaryCollapsedSeriesIndices.indexOf(a) === -1
) {
activeIndex = firstActiveSeriesIndex[a]
break
}
Expand Down

0 comments on commit d4619e1

Please sign in to comment.