Skip to content

Commit

Permalink
chore(bi): goal line visibility (PostHog#27927)
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE authored Jan 27, 2025
1 parent f68c421 commit 9b1365a
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ export const LineGraph = (): JSX.Element => {
const annotations = ctx.chart.options.plugins.annotation.annotations as Record<string, any>
if (annotations[`line${curIndex}`]) {
annotations[`line${curIndex}`].label.content = `${cur.label}: ${cur.value}`
// Hide the external tooltip element
const tooltipEl = document.getElementById('InsightTooltipWrapper')

if (tooltipEl) {
tooltipEl.style.display = 'none'
}

ctx.chart.update()
}
}
Expand All @@ -202,6 +209,13 @@ export const LineGraph = (): JSX.Element => {
const annotations = ctx.chart.options.plugins.annotation.annotations as Record<string, any>
if (annotations[`line${curIndex}`]) {
annotations[`line${curIndex}`].label.content = cur.label

// Show the external tooltip element
const tooltipEl = document.getElementById('InsightTooltipWrapper')
if (tooltipEl) {
tooltipEl.style.display = 'block'
}

ctx.chart.update()
}
}
Expand Down

0 comments on commit 9b1365a

Please sign in to comment.