Skip to content

Commit

Permalink
fix: custom name for horizontal bar chart appears twice (#24729)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoti143 authored Sep 3, 2024
1 parent 0b5c8b4 commit 9f3093b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frontend/src/scenes/insights/views/LineGraph/LineGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ export function LineGraph_({
d.compareLabels?.[i],
]
} else if (d.breakdownLabels?.[i]) {
labelDescriptors = [d.breakdownLabels[i], d.compareLabels?.[i]]
labelDescriptors = [d.actions?.[i]?.name, d.breakdownLabels[i], d.compareLabels?.[i]]
} else if (d.labels?.[i]) {
labelDescriptors = [d.labels[i], d.compareLabels?.[i]]
} else {
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/scenes/trends/viz/ActionsHorizontalBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,12 @@ export function ActionsHorizontalBar({ showPersonsModal = true }: ChartParams):
personsValues: _data.map((item) => item.persons),
breakdownValues: _data.map((item) => item.breakdown_value),
breakdownLabels: _data.map((item) => {
const itemLabel = item.action
? item.action.custom_name ?? item.action.name ?? item.action.id
: item.label

if (!item.breakdown_value) {
return itemLabel
}

const breakdownLabel = formatBreakdownLabel(
return formatBreakdownLabel(
item.breakdown_value,
breakdownFilter,
cohorts,
formatPropertyValueForDisplay
)

return `${itemLabel} - ${breakdownLabel}`
}),
compareLabels: _data.map((item) => item.compare_label),
backgroundColor: colorList,
Expand Down

0 comments on commit 9f3093b

Please sign in to comment.