Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(insights): show annotations on SQL charts (#90013)

Sam Pennington2e42f328ee3a
diff --git a/products/product_analytics/frontend/insights/trends/shared/AnnotationsLayer.tsx b/frontend/src/lib/components/AnnotationsOverlay/AnnotationsLayer.tsx
similarity index 97%
rename from products/product_analytics/frontend/insights/trends/shared/AnnotationsLayer.tsx
rename to frontend/src/lib/components/AnnotationsOverlay/AnnotationsLayer.tsx
index 39f194fcc945..de09be8a2526 100644
--- a/products/product_analytics/frontend/insights/trends/shared/AnnotationsLayer.tsx
+++ b/frontend/src/lib/components/AnnotationsOverlay/AnnotationsLayer.tsx
@@ -2,7 +2,8 @@ import React, { useMemo } from 'react'
import { computeVisibleXLabels, useChartLayout } from '@posthog/quill-charts'
-import { AnnotationsOverlay, type AnnotationsChartGeometry } from 'lib/components/AnnotationsOverlay'
+import { AnnotationsOverlay } from './AnnotationsOverlay'
+import type { AnnotationsChartGeometry } from './useAnnotationsPositioning'
interface AnnotationsLayerProps {
/** Numeric insight id used by the annotations logic. Pass `'new'` for unsaved insights. */
diff --git a/frontend/src/queries/Query/Query.tsx b/frontend/src/queries/Query/Query.tsx
index bacde72302cd..ffdf07174681 100644
--- a/frontend/src/queries/Query/Query.tsx
+++ b/frontend/src/queries/Query/Query.tsx
@@ -148,6 +148,7 @@ export function Query<Q extends Node>(props: QueryProps<Q>): JSX.Element | null
context={queryContext}
readOnly={readOnly}
embedded={embedded}
+ inSharedMode={inSharedMode}
editMode={!!editMode}
variablesOverride={props.variablesOverride}
/>
diff --git a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlBarGraph.tsx b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlBarGraph.tsx
index 9cca7ac329c9..9b69e7307e24 100644
--- a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlBarGraph.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlBarGraph.tsx
@@ -3,6 +3,8 @@ import { useCallback } from 'react'
import { TimeSeriesBarChart, type PointClickData } from '@posthog/quill-charts'
+import { AnnotationsLayer } from 'lib/components/AnnotationsOverlay/AnnotationsLayer'
+
import { makeChartErrorHandler } from 'products/product_analytics/frontend/insights/trends/shared/chartErrorHandler'
import { type SqlChartProps } from './SqlChart'
@@ -38,7 +40,11 @@ export const SqlBarGraph = (props: SqlChartProps): JSX.Element => {
config={model.config}
onPointClick={onPointClickProp ? onPointClick : undefined}
onError={handleChartError}
- />
+ >
+ {props.showAnnotations && props.insightNumericId && (
+ <AnnotationsLayer insightNumericId={props.insightNumericId} dates={model.labels} />
+ )}
+ </TimeSeriesBarChart>
)}
</div>
)
diff --git a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlChart.tsx b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlChart.tsx
index 3e2e0525746c..980a6ba249b1 100644
--- a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlChart.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlChart.tsx
@@ -16,6 +16,8 @@ export type SqlChartProps = {
presetChartHeight?: boolean
dashboardId?: string
goalLines?: GoalLine[]
+ insightNumericId?: number | 'new'
+ showAnnotations?: boolean
className?: string
/** Called when the user clicks a data point. Receives the series key, x-axis index, and label.
* When provided, the SQL chart shows a "click to inspect" hint in the tooltip. */
diff --git a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlComboGraph.tsx b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlComboGraph.tsx
index d090f627136d..d2fd3ce1163d 100644
--- a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlComboGraph.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlComboGraph.tsx
@@ -2,6 +2,8 @@ import clsx from 'clsx'
import { TimeSeriesComboChart } from '@posthog/quill-charts'
+import { AnnotationsLayer } from 'lib/components/AnnotationsOverlay/AnnotationsLayer'
+
import { makeChartErrorHandler } from 'products/product_analytics/frontend/insights/trends/shared/chartErrorHandler'
import { type SqlChartProps } from './SqlChart'
@@ -34,7 +36,11 @@ export const SqlComboGraph = (props: SqlChartProps): JSX.Element => {
theme={model.theme}
config={model.config}
onError={handleChartError}
- />
+ >
+ {props.showAnnotations && props.insightNumericId && (
+ <AnnotationsLayer insightNumericId={props.insightNumericId} dates={model.labels} />
+ )}
+ </TimeSeriesComboChart>
)}
</div>
)
diff --git a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.test.tsx b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.test.tsx
index 94159bfffb1d..2f046be8bd9d 100644
--- a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.test.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.test.tsx
@@ -15,7 +15,8 @@ import {
renderWithInsights,
sqlChart,
} from '~/test/insight-testing'
-import { ChartDisplayType } from '~/types'
+import { buildAnnotation } from '~/test/insight-testing/test-data'
+import { AnnotationScope, ChartDisplayType } from '~/types'
import { AxisSeries } from '../../dataVisualizationLogic'
import { SqlChartProps } from './SqlChart'
@@ -115,6 +116,58 @@ const renderLine = (
})
describe('SqlLineGraph', () => {
+ describe('annotations', () => {
+ it('renders annotations when enabled', async () => {
+ renderDataVisualization({
+ query: buildDataVisualizationQuery({
+ display: ChartDisplayType.ActionsLineGraph,
+ chartSettings: { xAxis: { column: 'month' }, showAnnotations: true },
+ }),
+ response: twoSeries(),
+ mocks: {
+ annotations: [
+ buildAnnotation({
+ scope: AnnotationScope.Project,
+ content: 'Feature released',
+ date_marker: '2025-12-01T12:00:00Z',
+ }),
+ ],
+ },
+ })
+
+ await waitFor(() => {
+ expect(
+ [...document.querySelectorAll<HTMLButtonElement>('.AnnotationsBadge')].some(
+ (element) => element.textContent === '1'
+ )
+ ).toBe(true)
+ })
+ })
+
+ it('does not render annotations for a categorical X axis', async () => {
+ renderDataVisualization({
+ query: buildDataVisualizationQuery({
+ display: ChartDisplayType.ActionsLineGraph,
+ chartSettings: { xAxis: { column: 'category' }, showAnnotations: true },
+ }),
+ response: {
+ columns: ['category', 'accounts'],
+ types: [
+ ['category', 'String'],
+ ['accounts', 'UInt64'],
+ ],
+ results: [
+ ['small', 1],
+ ['large', 2],
+ ],
+ },
+ })
+
+ await screen.findByLabelText(/chart with/i)
+ expect(document.querySelectorAll('.AnnotationsBadge')).toHaveLength(0)
+ })
+ })
+
describe('y-axis tick formatting', () => {
const waitForYTicks = async (): Promise<string[]> => {
await waitFor(() => expect(getHogChart().yTicks().length).toBeGreaterThan(0))
diff --git a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.tsx b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.tsx
index c2ee8e3d6d72..8ba0a9140dcb 100644
--- a/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/Components/Charts/SqlLineGraph.tsx
@@ -3,6 +3,8 @@ import { useCallback } from 'react'
import { DefaultTooltip, TimeSeriesLineChart, type PointClickData, type TooltipContext } from '@posthog/quill-charts'
+import { AnnotationsLayer } from 'lib/components/AnnotationsOverlay/AnnotationsLayer'
+
import { makeChartErrorHandler } from 'products/product_analytics/frontend/insights/trends/shared/chartErrorHandler'
import { type SqlChartProps } from './SqlChart'
@@ -73,7 +75,11 @@ export const SqlLineGraph = (props: SqlChartProps): JSX.Element => {
tooltip={onPointClickProp ? renderTooltip : undefined}
onPointClick={onPointClickProp ? onPointClick : undefined}
onError={handleChartError}
- />
+ >
+ {props.showAnnotations && props.insightNumericId && (
+ <AnnotationsLayer insightNumericId={props.insightNumericId} dates={model.labels} />
+ )}
+ </TimeSeriesLineChart>
)}
</div>
)
diff --git a/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.test.tsx b/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.test.tsx
index 28e80824d02d..0749196ce26d 100644
--- a/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.test.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.test.tsx
@@ -4,7 +4,7 @@ import { cleanup, render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { BindLogic } from 'kea'
-import { DataVisualizationNode, NodeKind } from '~/queries/schema/schema-general'
+import { DataVisualizationNode, HogQLQueryResponse, NodeKind } from '~/queries/schema/schema-general'
import { initKeaTests } from '~/test/init'
import { ChartDisplayType } from '~/types'
@@ -60,6 +60,63 @@ describe('DisplayTab', () => {
expect(screen.queryByText('Show labels')).not.toBeInTheDocument()
})
+ it('keeps annotations off by default and persists the toggle', async () => {
+ initKeaTests()
+
+ const key = 'display-tab-annotations-test'
+ let query: DataVisualizationNode = {
+ kind: NodeKind.DataVisualizationNode,
+ source: {
+ kind: NodeKind.HogQLQuery,
+ query: 'select day, accounts from numbers(2)',
+ },
+ display: ChartDisplayType.ActionsLineGraph,
+ chartSettings: { xAxis: { column: 'day' } },
+ }
+
+ const props: DataVisualizationLogicProps = {
+ key,
+ query,
+ dataNodeCollectionId: key,
+ cachedResults: {
+ columns: ['day', 'accounts'],
+ types: [
+ ['day', 'Date'],
+ ['accounts', 'UInt64'],
+ ],
+ results: [
+ ['2026-01-01', 1],
+ ['2026-01-02', 2],
+ ],
+ hogql: '',
+ hasMore: false,
+ } as HogQLQueryResponse,
+ setQuery: (setter) => {
+ query = setter(query)
+ },
+ }
+
+ dataVisualizationLogic(props).mount()
+ displayLogic({ key }).mount()
+
+ render(
+ <BindLogic logic={dataVisualizationLogic} props={props}>
+ <BindLogic logic={displayLogic} props={{ key }}>
+ <DisplayTab />
+ </BindLogic>
+ </BindLogic>
+ )
+
+ const annotationsToggle = await screen.findByLabelText('Show annotations')
+ expect(annotationsToggle).not.toBeChecked()
+
+ await userEvent.click(annotationsToggle)
+
+ await waitFor(() => {
+ expect(query.chartSettings?.showAnnotations).toBe(true)
+ })
+ })
+
it('persists chart axis labels without dropping existing axis settings', async () => {
initKeaTests()
@@ -170,6 +227,7 @@ describe('DisplayTab', () => {
expect(screen.queryByText('Right Y-axis')).not.toBeInTheDocument()
expect(screen.queryByText('Goals')).not.toBeInTheDocument()
expect(screen.queryByText('Show total row')).not.toBeInTheDocument()
+ expect(screen.queryByText('Show annotations')).not.toBeInTheDocument()
await user.click(screen.getByText('Exclude outliers'))
await user.click(screen.getByText('Y-axis'))
diff --git a/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.tsx b/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.tsx
index adc6cdb58b60..63b2ebf93a24 100644
--- a/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/Components/DisplayTab.tsx
@@ -36,7 +36,7 @@ const LINE_STYLE_OPTIONS: { value: 'smooth' | 'linear'; label: string }[] = [
]
export const DisplayTab = (): JSX.Element => {
- const { effectiveVisualizationType } = useValues(dataVisualizationLogic)
+ const { effectiveVisualizationType, xData } = useValues(dataVisualizationLogic)
const { goalLines, chartSettings } = useValues(displayLogic)
const { addGoalLine, updateGoalLine, removeGoalLine, updateChartSettings } = useActions(displayLogic)
@@ -49,6 +49,12 @@ export const DisplayTab = (): JSX.Element => {
const isLineChart =
effectiveVisualizationType === ChartDisplayType.ActionsLineGraph ||
effectiveVisualizationType === ChartDisplayType.ActionsAreaGraph
+ const isDateXAxis = xData?.column.type.name === 'DATE' || xData?.column.type.name === 'DATETIME'
+ const supportsAnnotations =
+ isDateXAxis &&
+ (isLineChart ||
+ effectiveVisualizationType === ChartDisplayType.ActionsBar ||
+ effectiveVisualizationType === ChartDisplayType.ActionsStackedBar)
const renderYAxisSettings = (name: 'leftYAxisSettings' | 'rightYAxisSettings'): JSX.Element => {
const leftPlaceholder = isSingleAxisChart ? 'Y-axis label' : 'Left Y-axis label'
@@ -146,6 +152,17 @@ export const DisplayTab = (): JSX.Element => {
}}
/>
)}
+ {supportsAnnotations && (
+ <LemonSwitch
+ className="flex-1 w-full"
+ data-attr="data-visualization-show-annotations"
+ label="Show annotations"
+ checked={chartSettings.showAnnotations ?? false}
+ onChange={(value) => {
+ updateChartSettings({ showAnnotations: value })
+ }}
+ />
+ )}
{isPieChart ? (
<>
<div className="flex flex-col gap-1">
diff --git a/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx b/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx
index 99e25bd1d5cf..6184f1874a17 100644
--- a/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx
@@ -62,6 +62,7 @@ export interface DataTableVisualizationProps {
editMode?: boolean
readOnly?: boolean
embedded?: boolean
+ inSharedMode?: boolean
exportContext?: ExportContext
/** Dashboard variables to override the ones in the query */
variablesOverride?: Record<string, HogQLVariable> | null
@@ -82,6 +83,7 @@ export function DataTableVisualization({
attachTo,
editMode,
embedded,
+ inSharedMode,
}: DataTableVisualizationProps): JSX.Element {
const [key] = useState(`DataVisualizationNode.${uniqueKey ?? uniqueNode++}`)
const queryRef = useRef(query)
@@ -158,6 +160,7 @@ export function DataTableVisualization({
exportContext={exportContext}
editMode={editMode}
embedded={embedded}
+ inSharedMode={inSharedMode}
/>
</BindLogic>
</BindLogic>
@@ -219,6 +222,8 @@ function InternalDataTableVisualization(props: DataTableVisualizationProps): JSX
[props.setQuery, props.query] // oxlint-disable-line react-hooks/exhaustive-deps
)
+ const isDateXAxis = xData?.column.type.name === 'DATE' || xData?.column.type.name === 'DATETIME'
+
let component: JSX.Element | null = null
if (responseError) {
@@ -263,16 +268,20 @@ function InternalDataTableVisualization(props: DataTableVisualizationProps): JSX
const _xData = seriesBreakdownData.xData.data.length ? seriesBreakdownData.xData : xData
const _yData = seriesBreakdownData.xData.data.length ? seriesBreakdownData.seriesData : yData
component = (
- <SqlChart
- className="p-3"
- xData={_xData}
- yData={_yData}
- visualizationType={effectiveVisualizationType}
- chartSettings={chartSettings}
- dashboardId={dashboardId}
- goalLines={[...alertThresholdLines, ...goalLines]}
- presetChartHeight={presetChartHeight}
- />
+ <BindLogic logic={insightLogic} props={alertsInsightProps}>
+ <SqlChart
+ className="p-3"
+ xData={_xData}
+ yData={_yData}
+ visualizationType={effectiveVisualizationType}
+ chartSettings={chartSettings}
+ dashboardId={dashboardId}
+ goalLines={[...alertThresholdLines, ...goalLines]}
+ insightNumericId={insight?.id || 'new'}
+ showAnnotations={!props.inSharedMode && isDateXAxis && chartSettings.showAnnotations === true}
+ presetChartHeight={presetChartHeight}
+ />
+ </BindLogic>
)
} else if (effectiveVisualizationType === ChartDisplayType.ActionsPie) {
const _xData = seriesBreakdownData.xData.data.length ? seriesBreakdownData.xData : xData
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 3990a8e22e72..9e8b49e5284f 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -16196,6 +16196,9 @@
"seriesBreakdownColumn": {
"type": ["string", "null"]
},
+ "showAnnotations": {
+ "type": "boolean"
+ },
"showLegend": {
"type": "boolean"
},
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index 4fd112be8b60..ac3285161455 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -1396,6 +1396,7 @@ export interface ChartSettings {
showXAxisBorder?: boolean
showYAxisBorder?: boolean
showLegend?: boolean
+ showAnnotations?: boolean
showValuesOnSeries?: boolean
// Deprecated: superseded by `pie.showTotal`. Retained so pre-existing pie-chart insights still
// validate (ChartSettings is `extra="forbid"`). Read as a fallback in the pie chart components.
diff --git a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
index d4961efd1f38..e5787e5d1286 100644
--- a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
@@ -2,7 +2,7 @@ import './DataGrid.scss'
import 'react-data-grid/lib/styles.css'
import clsx from 'clsx'
-import { useActions, useValues } from 'kea'
+import { BindLogic, useActions, useValues } from 'kea'
import { useCallback, useMemo, useRef, useState } from 'react'
import DataGrid, { DataGridProps, RenderHeaderCellProps, SortColumn } from 'react-data-grid'
@@ -35,6 +35,7 @@ import { LoadingBar } from 'lib/lemon-ui/LoadingBar'
import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
import { copyToClipboard } from 'lib/utils/copyToClipboard'
import { InsightErrorState, StatelessInsightLoadingState } from 'scenes/insights/EmptyStates'
+import { insightLogic } from 'scenes/insights/insightLogic'
import { HogQLBoldNumber } from 'scenes/insights/views/BoldNumber/BoldNumber'
import { urls } from 'scenes/urls'
@@ -932,6 +933,9 @@ function InternalDataTableVisualization(
const { seriesBreakdownData } = useValues(seriesBreakdownLogic({ key: dataVisualizationProps.key }))
const { goalLines } = useValues(displayLogic)
+ const { editingInsight } = useValues(sqlEditorLogic)
+
+ const isDateXAxis = xData?.column.type.name === 'DATE' || xData?.column.type.name === 'DATETIME'
let component: JSX.Element | null = null
@@ -961,16 +965,20 @@ function InternalDataTableVisualization(
const _xData = seriesBreakdownData.xData.data.length ? seriesBreakdownData.xData : xData
const _yData = seriesBreakdownData.xData.data.length ? seriesBreakdownData.seriesData : yData
component = (
- <SqlChart
- className="p-2"
- xData={_xData}
- yData={_yData}
- visualizationType={effectiveVisualizationType}
- chartSettings={chartSettings}
- dashboardId={dashboardId}
- goalLines={goalLines}
- presetChartHeight={presetChartHeight}
- />
+ <BindLogic logic={insightLogic} props={{ dashboardItemId: editingInsight?.short_id, doNotLoad: true }}>
+ <SqlChart
+ className="p-2"
+ xData={_xData}
+ yData={_yData}
+ visualizationType={effectiveVisualizationType}
+ chartSettings={chartSettings}
+ dashboardId={dashboardId}
+ goalLines={goalLines}
+ insightNumericId={editingInsight?.id || 'new'}
+ showAnnotations={isDateXAxis && chartSettings.showAnnotations === true}
+ presetChartHeight={presetChartHeight}
+ />
+ </BindLogic>
)
} else if (effectiveVisualizationType === ChartDisplayType.ActionsPie) {
const _xData = seriesBreakdownData.xData.data.length ? seriesBreakdownData.xData : xData
diff --git a/frontend/src/test/insight-testing/render-data-visualization.tsx b/frontend/src/test/insight-testing/render-data-visualization.tsx
index 017dbaf4322b..8e46bfbdb759 100644
--- a/frontend/src/test/insight-testing/render-data-visualization.tsx
+++ b/frontend/src/test/insight-testing/render-data-visualization.tsx
@@ -10,6 +10,7 @@ import { QueryContext } from '~/queries/types'
import { ChartDisplayType } from '~/types'
import { initKeaTests } from '../init'
+import { setupInsightMocks, type SetupMocksOptions } from './mocks'
export const DATA_VIZ_TEST_KEY = 'sql-test-harness'
@@ -54,6 +55,7 @@ export interface RenderDataVisualizationProps {
readOnly?: boolean
embedded?: boolean
context?: QueryContext<DataVisualizationNode>
+ mocks?: SetupMocksOptions
}
/** Mount a SQL insight (`DataVisualizationNode`) the way the real scene does — through
@@ -70,6 +72,8 @@ export function renderDataVisualization(props: RenderDataVisualizationProps): Re
ffLogic.mount()
ffLogic.actions.setFeatureFlags(Object.keys(featureFlags), featureFlags)
+ setupInsightMocks(props.mocks)
+
const cachedResults = buildHogQLResponse(props.response)
return render(
diff --git a/posthog/schema.py b/posthog/schema.py
index f5feff685161..97da8d8b38e1 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -15373,6 +15373,7 @@ class ChartSettings(BaseModel):
rightYAxisSettings: YAxisSettings | None = None
scatter: ScatterChartSettings | None = None
seriesBreakdownColumn: str | None = None
+ showAnnotations: bool | None = None
showLegend: bool | None = None
showNullsAsZero: bool | None = None
showPieTotal: bool | None = None
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index 49af0ce87b7c..d626b8c5a219 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -8838,6 +8838,7 @@ export interface ChartSettingsApi {
rightYAxisSettings?: YAxisSettingsApi | null
scatter?: ScatterChartSettingsApi | null
seriesBreakdownColumn?: string | null
+ showAnnotations?: boolean | null
showLegend?: boolean | null
showNullsAsZero?: boolean | null
showPieTotal?: boolean | null
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index 71abb76b507a..5f0e1578cc32 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -8000,6 +8000,7 @@ export interface ChartSettingsApi {
rightYAxisSettings?: YAxisSettingsApi | null
scatter?: ScatterChartSettingsApi | null
seriesBreakdownColumn?: string | null
+ showAnnotations?: boolean | null
showLegend?: boolean | null
showNullsAsZero?: boolean | null
showPieTotal?: boolean | null
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx
index 79bc309a7562..bbf5418d57f1 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx
+++ b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx
@@ -11,6 +11,7 @@ import type {
} from '@posthog/quill-charts'
import { useChartConfig, useChartTheme, useDateRangeZoom } from 'lib/charts/hooks'
+import { AnnotationsLayer } from 'lib/components/AnnotationsOverlay/AnnotationsLayer'
import { useChartLegendSeriesMenu } from 'lib/components/ChartLegendSeriesMenu/useChartLegendSeriesMenu'
import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic'
import { funnelPersonsModalLogic } from 'scenes/funnels/funnelPersonsModalLogic'
@@ -30,7 +31,6 @@ import { ChartParams, type FlattenedFunnelStepByBreakdown } from '~/types'
import { chartStyleCurve } from '../../shared/chartStyleAdapter'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
-import { AnnotationsLayer } from '../../trends/shared/AnnotationsLayer'
import { buildBaseLegendConfig } from '../../trends/shared/buildBaseLegendConfig'
import { FUNNEL_CONVERSION_SERIES_LABEL, type FunnelSeriesMeta } from '../shared/funnelSeriesMeta'
import { buildFunnelLineSeries, buildFunnelLineTimeSeriesConfig, type IndexedFunnelStep } from './funnelChartTransforms'
diff --git a/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx
index a7c905a4f2cb..57a9433bcdce 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx
@@ -13,6 +13,7 @@ import {
import type { BarChartConfig, PointClickData, TimeSeriesBarChartConfig, TooltipContext } from '@posthog/quill-charts'
import { useChartTheme, useChartConfig, useDateRangeZoom } from 'lib/charts/hooks'
+import { AnnotationsLayer } from 'lib/components/AnnotationsOverlay/AnnotationsLayer'
import { percentage } from 'lib/utils/numbers'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
@@ -34,7 +35,6 @@ import { ChartDisplayType } from '~/types'
import { hasTrendsChartData } from '../../shared/hasTrendsChartData'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
-import { AnnotationsLayer } from '../shared/AnnotationsLayer'
import { makeChartErrorHandler } from '../shared/chartErrorHandler'
import { getTrendsSeriesDisplayLabel } from '../shared/getTrendsSeriesDisplayLabel'
import { goalLinesToReferenceLines } from '../shared/goalLinesAdapter'
diff --git a/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx
index 3f3bc4a609ca..9bc152a7910a 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx
@@ -6,6 +6,7 @@ import type { ChartLegendConfig, PointClickData, TooltipContext } from '@posthog
import { useChartConfig, useChartTheme, useDateRangeZoom } from 'lib/charts/hooks'
import { getBarColorFromStatus } from 'lib/colors'
+import { AnnotationsLayer } from 'lib/components/AnnotationsOverlay/AnnotationsLayer'
import { useChartLegendSeriesMenu } from 'lib/components/ChartLegendSeriesMenu/useChartLegendSeriesMenu'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
@@ -22,7 +23,6 @@ import type { LifecycleToggle } from '~/types'
import { hasTrendsChartData } from '../../shared/hasTrendsChartData'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { AnnotationsLayer } from '../shared/AnnotationsLayer'
import { buildBaseLegendConfig } from '../shared/buildBaseLegendConfig'
import { makeChartErrorHandler } from '../shared/chartErrorHandler'
import {
diff --git a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
index 13c2588a24a1..5239efe49d71 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
@@ -6,6 +6,7 @@ import { DEFAULT_Y_AXIS_ID, TimeSeriesLineChart } from '@posthog/quill-charts'
import type { PointClickData, TooltipContext } from '@posthog/quill-charts'
import { useChartTheme, useChartConfig, useDateRangeZoom } from 'lib/charts/hooks'
+import { AnnotationsLayer } from 'lib/components/AnnotationsOverlay/AnnotationsLayer'
import { dayjs } from 'lib/dayjs'
import { ciRanges } from 'lib/statistics'
import { percentage } from 'lib/utils/numbers'
@@ -31,7 +32,6 @@ import { chartStyleCurve } from '../../shared/chartStyleAdapter'
import { hasTrendsChartData } from '../../shared/hasTrendsChartData'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
-import { AnnotationsLayer } from '../shared/AnnotationsLayer'
import { makeChartErrorHandler } from '../shared/chartErrorHandler'
import { getTrendsSeriesDisplayLabel } from '../shared/getTrendsSeriesDisplayLabel'
import { handleTrendsChartClick } from '../shared/handleTrendsChartClick'
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 1754782a62c3..c7eaba6cc60b 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -8692,6 +8692,7 @@ export namespace Schemas {
rightYAxisSettings?: YAxisSettings | null;
scatter?: ScatterChartSettings | null;
seriesBreakdownColumn?: string | null;
+ showAnnotations?: boolean | null;
showLegend?: boolean | null;
showNullsAsZero?: boolean | null;
showPieTotal?: boolean | null;