Skip to content

Commit

Permalink
fix #2012; fix annotations when category labels are provided in array
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Sep 24, 2024
1 parent d5cde8c commit 3de2918
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/annotations/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ export default class Helpers {
x = w.globals.categoryLabels.indexOf(x) + 1
}

const catIndex = w.globals.labels.indexOf(x)
const catIndex = w.globals.labels
.map((item) => (Array.isArray(item) ? item.join(' ') : item))
.indexOf(x)

console.log(catIndex)
const xLabel = w.globals.dom.baseEl.querySelector(
`.apexcharts-xaxis-texts-g text:nth-child(${catIndex + 1})`
)
Expand Down

0 comments on commit 3de2918

Please sign in to comment.