Skip to content

Commit

Permalink
Show actual dates on trends when comparing periods
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Nov 30, 2023
1 parent 3fc1a08 commit cb662e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/src/scenes/trends/viz/ActionsLineGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export function ActionsLineGraph({
isStickiness,
} = useValues(trendsDataLogic(insightProps))

const labels =
(indexedResults.length === 2 &&
indexedResults.every((x) => x.compare) &&
indexedResults.find((x) => x.compare_label === 'current')?.days) ||
(indexedResults[0] && indexedResults[0].labels) ||
[]

return indexedResults &&
indexedResults[0]?.data &&
indexedResults.filter((result) => result.count !== 0).length > 0 ? (
Expand All @@ -51,7 +58,7 @@ export function ActionsLineGraph({
type={display === ChartDisplayType.ActionsBar || isLifecycle ? GraphType.Bar : GraphType.Line}
hiddenLegendKeys={hiddenLegendKeys}
datasets={indexedResults}
labels={(indexedResults[0] && indexedResults[0].labels) || []}
labels={labels}
inSharedMode={inSharedMode}
labelGroupType={labelGroupType}
showPersonsModal={showPersonsModal}
Expand Down

0 comments on commit cb662e3

Please sign in to comment.