diff --git a/frontend/src/lib/components/InsightLegend/InsightLegend.tsx b/frontend/src/lib/components/InsightLegend/InsightLegend.tsx index c311b1d39dc76..41a91f038ad60 100644 --- a/frontend/src/lib/components/InsightLegend/InsightLegend.tsx +++ b/frontend/src/lib/components/InsightLegend/InsightLegend.tsx @@ -3,9 +3,8 @@ import { useActions, useValues } from 'kea' import { insightLogic } from 'scenes/insights/insightLogic' import clsx from 'clsx' import { InsightLegendRow } from './InsightLegendRow' -import { shouldHighlightThisRow, DISPLAY_TYPES_WITHOUT_LEGEND } from './utils' +import { shouldHighlightThisRow } from './utils' import { trendsDataLogic } from 'scenes/trends/trendsDataLogic' -import { ChartDisplayType } from '~/types' export interface InsightLegendProps { readOnly?: boolean @@ -17,9 +16,9 @@ export function InsightLegend({ horizontal, inCardView, readOnly = false }: Insi // TODO: replace isSingleSeries etc. with data exploration variant const { insightProps, highlightedSeries, isSingleSeries, hiddenLegendKeys } = useValues(insightLogic) const { toggleVisibility } = useActions(insightLogic) - const { indexedResults, compare, display, trendsFilter } = useValues(trendsDataLogic(insightProps)) + const { indexedResults, compare, display, trendsFilter, hasLegend } = useValues(trendsDataLogic(insightProps)) - return DISPLAY_TYPES_WITHOUT_LEGEND.includes(display || ('' as ChartDisplayType)) ? ( + return hasLegend ? (