Stacked bar chart for Total Values in Trends Insight
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
Feature request
Is your feature request related to a problem?
I want to make a stacked bar chart in the Trends insight that has the following:
- X-axis: Breakdown of
sourceproperty - Y-axis (the stacked bars): Breakdown of
query_source_kindproperty - Value: Total insight creates
This would let me visualize the distribution of insight types by source. Currently, I cannot do this in Trends and have to resort to a Custom SQL insight.
When I use multiple breakdowns in a bar chart, this is the closest I can get:
Describe the solution you'd like
Looking for something like this:
I could also see us having a "Breakdown" insight as its own insight type. This could include all static charts (without a time series):
- Table
- Bar chart (horizontal + vertical)
- Pivot table / heat map: https://github.com/PostHog/posthog/issues/20251
- Stacked bar chart (this issue)
- World map
Describe alternatives you've considered
I can use the SQL editor to build this chart, but it feels like it should be possible as a trend
Additional context
Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name files, tests, or entry points. Start by locating the Trends insight implementation and its existing multiple-breakdown bar-chart handling, then trace how chart configuration reaches the UI. Done means Trends can display total insight counts with source on the x-axis and query_source_kind as stacked segments, with coverage for the new configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, react, typescript
- Domain
- analytics, data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100