PostHog / PostHog/posthog

Stacked bar chart for Total Values in Trends Insight

Open
#69,669 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement team/product-analytics
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 source property
  • Y-axis (the stacked bars): Breakdown of query_source_kind property
  • 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:

Image

Describe the solution you'd like

Looking for something like this:

Image

I could also see us having a "Breakdown" insight as its own insight type. This could include all static charts (without a time series):

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.