Repository navigation
Description
The chart engine supports ten x-axis dimensions and can segment any of them by any other. The analytics page hardcodes five combinations of that and hides the rest.
From packages/core/src/analytics/schemas.ts:
export const CHART_DIMENSIONS = [
'state', 'state_group', 'assignee', 'project', 'label',
'priority', 'estimate', 'cycle', 'created_month', 'completed_month',
] as const;buildChart takes an xAxis and an optional segment and pivots correctly for any pair. That is up to a hundred charts. The page ships four distributions and one breakdown, all fixed at build time.
So nobody can ask "issues by priority, stacked by state", or "completed per month by team", even though the SQL to answer both already runs in production.
What to build
A chart builder on the analytics page, or on a tab of it:
- Pick an x axis from the ten dimensions.
- Optionally pick a segment to stack by.
- Pick a measure, issues or points.
- Inherit the page scope and date range from the header controls.
- Render as bars, stacked bars, or a table.
- Save it.
saved_analytics_viewand thesavedAnalyticsView*schemas and functions inpackages/core/src/analytics/saved-view.tsalready exist and are already wired to/api/analytics/views.SavedViewBarinapps/web/src/features/analytics/saved-view-bar.tsxrenders saved views today. So persistence is done, and this issue is about giving people something worth saving.
POST /api/analytics/chart already accepts exactly this request shape and returns a ChartResult. The route is sixteen lines and does no work of its own. You are building a UI for an API that is already live.
Details that matter
- Label the dimensions in human language.
state_groupandcreated_monthare internal names. There is alabels.tsinapps/web/src/features/analytics/doing some of this for state groups already. - Not every pair is meaningful.
created_monthsegmented bycompleted_monthis technically valid and reads as noise. You do not have to prevent it, but ordering the list so the useful dimensions come first is worth doing. - Cardinality. Segmenting by label on a workspace with two hundred labels produces a chart with two hundred series. Cap the segments, group the tail, and say that you did.
- Empty results. A combination with no data should say so rather than rendering an axis with nothing in it.
Files
apps/web/src/features/analytics/for the new UIapps/web/src/app/api/analytics/chart/route.ts, existing, probably unchangedpackages/core/src/analytics/schemas.tsfor the dimension listpackages/core/src/analytics/saved-view.tsfor persistence
Scope note
This depends on the date range and scope picker issues in the same milestone in the sense that it should inherit them, but it does not have to wait for them. Build it against the workspace scope and wire the header controls in when they land.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
imshashank commentedon Aug 15, 2026
Still open, but the ground under it moved. Worth reading before anyone starts.
What changed. The planning cockpit in #309 replaced the analytics page with four fixed lenses (overview, sprints, projects, people) driven by
analyticsQuerySchema, which carries a range, a filter group, a measure, a comparison and a focus. So the page is no longer "four hardcoded distributions and one breakdown", but it is still a fixed set of questions rather than a builder.What is still true.
buildChartstill supports the ten dimensions listed here with any pair segmented,CHART_DIMENSIONSinpackages/core/src/analytics/schemas.tsis unchanged, andPOST /api/analytics/chartstill acceptschartRequestSchemaand returns aChartResult. So the premise holds: there is a general engine behind a page that exposes a fixed slice of it. Nobody can still ask for "issues by priority, stacked by state".What is now wrong in the description. Three things:
savedDashboardConfigSchemanow stores ananalyticsQuerySchema, which has no concept of an x axis or a segment, so a saved chart needs a config shape that does not exist yet. Adding one alongsidekind: 'dashboard'is the natural move, but it is work this issue currently assumes away.chartRequestSchemahas no range or filter. Add a date range filter to analytics, in the engine and the UI #177 added both to the lens query model and deliberately leftchartRequestSchemaalone. So "inherit the page scope and date range from the header controls" is not wiring, it is extending the chart engine to accept what the toolbar produces. That is the largest piece of this issue now and it was not in the original estimate.labels.tsandsaved-view-bar.tsxstill exist, butdistribution-section.tsxandmeasure-toggle.tsx, referenced as the surrounding pattern, are dead code.Revised shape. The builder is now most naturally a fifth lens rather than a tab bolted next to the existing ones, sharing the toolbar so range, filter and measure come for free. That makes point 2 above a prerequisite rather than an optional nicety.
Everything in "details that matter" still applies unchanged: human labels for
state_groupandcreated_month, ordering the useful dimensions first, capping segment cardinality and saying so, and an explicit empty state.imshashank commentedon Sep 6, 2026
Closing as not planned for now. The lens rebuild in #309 answers most of the questions this was for, and nobody has asked for a free-form builder since. The engine still supports it (
buildChart,CHART_DIMENSIONS), so this reopens the day somebody has a chart they cannot get from a lens.