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.

fix(insights): hide pie '% of total' option when series values are off (#65074)

Sam Pennington383cb215153d
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 89e95f12f74f..ae169eeccba2 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -4925,9 +4925,9 @@ snapshots:
scenes-app-dashboards-templates-dashboard-template-copy--no-other-projects-in-organization--light:
hash: v1.k794b7964.8d4cd29cef2f26f584fb54d8b66c4876ae47ad47c2c66d64df84e5fd39729a1b.07RDbDS_E-gMcaMuHJ_R9xJQB3iSqPEFC3Evki06JKs
scenes-app-dashboards-templates-dashboard-template-item--all-versions--dark:
- hash: v1.k794b7964.e9b8ff2046b506e9ea0d6fc7631c9ab733fa2c2a4f0cca7840d06f94210db9ab.s4QfFawRug02evRoMDDO8zl2fXpXkaav0IMq_FGCjtM
+ hash: v1.k794b7964.d1098ac00a7e4c40046b4d63cd9d1fd016d2d01b59b9022255319cdd9021e48c.Eu1n4qQvklGLxTj0LLacq7mobvT7POSt7fF8RMG2gf8
scenes-app-dashboards-templates-dashboard-template-item--all-versions--light:
- hash: v1.k794b7964.dbfb45bf4f32eed1ead7f2113b41c0c620e231ae19f7a5c0a06bc60475333009.ywACjnuOj9-vd49O4ttNAFemtLiYzV01Spiw9MPg9nM
+ hash: v1.k794b7964.489fcd39fd9a402472ccf4640182ee311ada8843e7cfd18779108a6c96f56be0.WTls6owUdMJZhF0JhBsHei4plrD-EdPYhT2pmZSwVCk
scenes-app-dashboards-templates-dashboard-templates-table--default--dark:
hash: v1.k794b7964.4196daeefa23df95ea8a8e0050c7ed33ccbe7eda0826d86f76714fd61d9aee07.ccK2iI3xPtiuBJU88n45tC0Q2UdWu_VKLgSd0dT7Xv0
scenes-app-dashboards-templates-dashboard-templates-table--default--light:
@@ -5517,17 +5517,17 @@ snapshots:
scenes-app-insights-funnels--funnel-historical-trends-edit--light:
hash: v1.k794b7964.296746d8a2788ab88883975bd97d8ab5cd502727c68cea48f5565501f722bd66.KurWhGCdkOzxxPW1LFjCoq3T9HxUNEXzOUEkrud6Smo
scenes-app-insights-funnels--funnel-left-to-right-breakdown-edit--dark:
- hash: v1.k794b7964.1df97c88a1076b096c08deccb8c4c291c13b6a4a59fb615e2d77254547381c48.gTsDByOCU_bfzNraCRF_0neMgtIfTq796QitehbRNVQ
+ hash: v1.k794b7964.2e764e6f3647ff86ca5c088a4b463b239254a854d85ae678755173e90c9714ab.uhusaADhMsDZRFVdbU0F9ViTpdzJKHD7Vo2QctRpMWU
scenes-app-insights-funnels--funnel-left-to-right-breakdown-edit--light:
- hash: v1.k794b7964.fcca265dc40531abfaeacdd71516413f6be97d773801b41204984515bcfef7e5.4QKORBqqQqXYcI8OeFErU3aC7gNVdKvl_HAZDwEsv_0
+ hash: v1.k794b7964.500e1fdfe93be682e9c64acfcf557b2bd12e8136c87481a772db2795db4fc170.t6FdCh7gk4-BNTRB_wzTVu8VcyyzJjHJbbZb_QyLjCU
scenes-app-insights-funnels--funnel-left-to-right-compare--dark:
hash: v1.k794b7964.c06558a5d730d4d4787f1c99172c390030bf55f05ed7596bd4d1f6bd0bbe0a1a.kxR9FFETw4hbO_cV17X3fMfFOrrxD2w-I8gACLI3WG4
scenes-app-insights-funnels--funnel-left-to-right-compare--light:
hash: v1.k794b7964.efd117b25bc08be5aafeea0d2eebbb2d4b07a542e762584e99b8b68172520877.emnTmFYizx7ABBBfqC7j-WmDRIqgqkQHt7Wv5kj0H4s
scenes-app-insights-funnels--funnel-left-to-right-edit--dark:
- hash: v1.k794b7964.293297b83994468984576e5c15fa2cbbb2c4c0a7a8234959b9deba539efa383b.xupnP9sdcp25xPBOMzrhSHwtRpKPLKHaqLDBncapvQA
+ hash: v1.k794b7964.20964c5fc0c9092c4d49421d8b86859cd8e34f7cbe5772c30b5cf615ac3195ba.dzFx3sC7oIadc1AGNEzOEKE8G_ckf3LBdf2EpE4AvOk
scenes-app-insights-funnels--funnel-left-to-right-edit--light:
- hash: v1.k794b7964.c63132bb5b13cbe97938ebdb2e59e320ebc338bd12b2d3bfd6af81e56270650a.3gc3UBg-8GVo4HkNBH7UrogK2q1uh9pXPDjTdYGT8nc
+ hash: v1.k794b7964.ef6ff8fcfe19c020b07a66ccce3e93aa11056c535ab152b848e89e6b7406dba2.s1QJ4bkZUJlA9qwl3ss9ZHHfPY-OfGZSY6yECXKzoLg
scenes-app-insights-funnels--funnel-left-to-right-edit-viewports--medium--dark:
hash: v1.k794b7964.a19c2dc89cb8873e8d184493709ff43f6f2fb078fbe833f7293f8dd52ec012ea.hlRoXvfjoSfTDzsV2QSQ3jer3fiZqfVc6lSZrsnEuHk
scenes-app-insights-funnels--funnel-left-to-right-edit-viewports--medium--light:
@@ -5537,9 +5537,9 @@ snapshots:
scenes-app-insights-funnels--funnel-left-to-right-edit-viewports--superwide--light:
hash: v1.k794b7964.a4910e3b150c07651b9ea86c326cc7b9dd1d43f6c56127826b323d3b75c5b814.6xgvV6z4bESi2u9Jp5lxC2wGcSm2wK2OvLLTlkzRsRk
scenes-app-insights-funnels--funnel-left-to-right-edit-viewports--wide--dark:
- hash: v1.k794b7964.293297b83994468984576e5c15fa2cbbb2c4c0a7a8234959b9deba539efa383b.O7SwG4Drfr3z02hcLNC1LsLsGWddouhybBp4xZaUE-A
+ hash: v1.k794b7964.20964c5fc0c9092c4d49421d8b86859cd8e34f7cbe5772c30b5cf615ac3195ba.pQpibJAZDRxXbfR52PXwzHBdvV46T-iCLgduKiJ54yc
scenes-app-insights-funnels--funnel-left-to-right-edit-viewports--wide--light:
- hash: v1.k794b7964.6c391cbc05b64230fbd8defdbb960b131fd433409817497873fb9ffc705cd360.EIwByuofuT77yP259A9ffqfjSFwW9MrUDOvsZNA_aZM
+ hash: v1.k794b7964.ef6ff8fcfe19c020b07a66ccce3e93aa11056c535ab152b848e89e6b7406dba2.-whJ_jGwxTf_nzSec874Pk6ox4Tz6spex4gRsJUg3OI
scenes-app-insights-funnels--funnel-time-to-convert--dark:
hash: v1.k794b7964.c744f53550b964a531653504150021418f1e4f3a97b49a5bdc630702c4f1e647.lWgC3HqBecT9i-QNSnIiRtqRCiPyxwGXhJgSphsG2ow
scenes-app-insights-funnels--funnel-time-to-convert--light:
diff --git a/frontend/src/queries/nodes/InsightViz/InsightDisplayConfig.tsx b/frontend/src/queries/nodes/InsightViz/InsightDisplayConfig.tsx
index 055d735853a8..efce303249ea 100644
--- a/frontend/src/queries/nodes/InsightViz/InsightDisplayConfig.tsx
+++ b/frontend/src/queries/nodes/InsightViz/InsightDisplayConfig.tsx
@@ -248,7 +248,25 @@ export function InsightDisplayConfig(): JSX.Element {
...(isLifecycle ? [{ label: () => <LifecycleStackingFilter /> }] : []),
...(supportsValueOnSeries ? [{ label: () => <ValueOnSeriesFilter /> }] : []),
...(isLifecycle ? [{ label: () => <LifecyclePercentagesFilter /> }] : []),
- ...(supportsPercentStackView ? [{ label: () => <PercentStackViewFilter /> }] : []),
+ ...(supportsPercentStackView
+ ? [
+ {
+ label: () => (
+ <PercentStackViewFilter
+ // On a pie chart the percentage is rendered through the
+ // series value labels, so it has no effect while those
+ // labels are hidden.
+ disabledReason={
+ display === ChartDisplayType.ActionsPie &&
+ showValuesOnSeries === false
+ ? "Enable 'Show values on series' to use this option"
+ : undefined
+ }
+ />
+ ),
+ },
+ ]
+ : []),
...(supportsBarValueStacking ? [{ label: () => <StackBreakdownFilter /> }] : []),
...(hasLegend || showFunnelLegendConfig
? [{ label: () => <ShowLegendFilter /> }]
diff --git a/frontend/src/scenes/insights/EditorFilters/PercentStackViewFilter.tsx b/frontend/src/scenes/insights/EditorFilters/PercentStackViewFilter.tsx
index 027319b6eb3c..cd7f1624f140 100644
--- a/frontend/src/scenes/insights/EditorFilters/PercentStackViewFilter.tsx
+++ b/frontend/src/scenes/insights/EditorFilters/PercentStackViewFilter.tsx
@@ -5,7 +5,7 @@ import { trendsDataLogic } from 'scenes/trends/trendsDataLogic'
import { insightLogic } from '../insightLogic'
-export function PercentStackViewFilter(): JSX.Element {
+export function PercentStackViewFilter({ disabledReason }: { disabledReason?: string }): JSX.Element {
const { insightProps } = useValues(insightLogic)
const { showPercentStackView } = useValues(trendsDataLogic(insightProps))
const { updateInsightFilter } = useActions(trendsDataLogic(insightProps))
@@ -19,6 +19,7 @@ export function PercentStackViewFilter(): JSX.Element {
}}
label={<span className="font-normal">Show as % of total</span>}
size="small"
+ disabledReason={disabledReason}
/>
)
}