Skip to content

Dashboard-level filters (date / region) driving multiple charts #2501

Description

@os-zhuang

Need

A dashboard has a top-level filter — a date range, a region select — that must drive several charts at once (e.g. 6 charts on one dashboard all re-scope to the selected date + region). This is a common, real requirement for any analytics dashboard.

Design (agreed in design discussion)

The filter is a dashboard-level parameter, not a shared dataset. Charts stay inline / self-contained.

  • The filter control + its value live on the dashboard — a dashboard-level variable (reuse the existing page/dashboard variables primitive; cf. the showcase Page Variables page / PageSchema.variables).
  • Each chart declares which of its own fields the filter binds to — a small binding, not a copied query. e.g. the invoice chart maps date → created_at, the account chart maps date → signed_at; region maps per-object similarly.
  • At render, the dashboard broadcasts { dateRange, region } into each chart's inline query (merged into its WHERE).

Result: one shared parameter (owned by the dashboard), explicit per-chart binding, charts remain inline. No hidden entity, no shared dataset — keeps it flat/explicit/local, which is also what keeps AI authoring safe (one place owns the filter; each chart edit stays local).

Scope

  • Dashboard filter controls (date range, select/multiselect) + dashboard-level variables holding their values.
  • Per-chart field binding so a chart declares which field(s) a given dashboard filter targets.
  • Runtime broadcast: dashboard injects filter values into each bound chart's query.
  • Sensible defaults (a chart auto-binds an obvious date/status field) with an explicit override.

Explicitly NOT this issue

A shared dataset is only needed when the parameter reshapes the query (rolling window, grain change, a join) or the filtered slice is a governed metric definition — not for the simple filter-broadcast case. Those are separate concerns; this issue is the common "filter drives N inline charts" path.

Acceptance

A dashboard with a date + region filter drives ≥2 charts over different objects; each chart maps the filter to its own field; changing the filter live re-scopes all bound charts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions