Skip to content

Commit

Permalink
fix: display label as tooltip title on stickiness graph (#24728)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoti143 authored Sep 2, 2024
1 parent 3a3fd06 commit c9cfc64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/scenes/insights/views/LineGraph/LineGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ export function LineGraph_({
if (tooltip.body) {
const referenceDataPoint = tooltip.dataPoints[0] // Use this point as reference to get the date
const dataset = datasets[referenceDataPoint.datasetIndex]
const date = dataset?.days?.[referenceDataPoint.dataIndex]
const seriesData = createTooltipData(tooltip.dataPoints, (dp) => {
const hasDotted =
datasets.some((d) => d.dotted) &&
Expand All @@ -498,7 +499,12 @@ export function LineGraph_({

tooltipRoot.render(
<InsightTooltip
date={dataset?.days?.[tooltip.dataPoints?.[0]?.dataIndex]}
date={date}
altTitle={() =>
typeof date === 'number'
? dataset?.labels?.[referenceDataPoint.dataIndex]
: null
}
timezone={timezone}
seriesData={seriesData}
breakdownFilter={breakdownFilter}
Expand Down

0 comments on commit c9cfc64

Please sign in to comment.