Apply dashboard date filters to chart queries

EH
43m ago
+2287-1420

What

Server side of dashboard date filters. The bar, line, and pie chart data queries accept dashboard filter values and apply them on top of the chart's own filter. No UI here: the filter bar and editor are in #32389.

How

  • Input. The three chart data queries take an optional pageFilterValues list (filter id, operand, value) next to widgetId.
  • Resolution. ChartPageFilterService reads the saved chart and its saved bindings, turns each value into a rule on the bound date field, and combines it with the chart's saved filter through the existing record query compiler. Values for a chart that is not saved, or does not match the request, are rejected.
  • Pie total. A filtered pie chart returns its center metric computed over the same chart and dashboard conditions as its slices, so slice limits and overlapping groups do not change it.
  • Timestamps. Before and After or equal accept a timestamp value as well as a calendar date.
  • IS_DASHBOARD_FILTERS_ENABLED gates all of it. Builds on #32230.

Testing

  • The chart data integration suite checks that the dashboard date and the chart's saved condition both apply for bar, line, and pie, including the pie center metric. It runs in CI.
  • Unit tests cover the date and timestamp default value validation.
  • Not tried in a running app: nothing sends these values until #32389.