Skip to content

[ENHANCEMENT] timeserieschart: add per-query stack override#670

Open
SoWieMarkus wants to merge 1 commit into
perses:mainfrom
SoWieMarkus:feat/exclude-time-series-from-stacking
Open

[ENHANCEMENT] timeserieschart: add per-query stack override#670
SoWieMarkus wants to merge 1 commit into
perses:mainfrom
SoWieMarkus:feat/exclude-time-series-from-stacking

Conversation

@SoWieMarkus
Copy link
Copy Markdown

@SoWieMarkus SoWieMarkus commented Jun 5, 2026

Description

Adds a per-query stack override to the Time Series Chart plugin, allowing individual queries to opt in or out of stacking regardless of the global visual stack setting. This mirrors the behavior of Grafana/Plutono, where stacking can be controlled at the series level.

What changed:

  • Added a stack?: bool field to QuerySettingsOptions in the model, CUE schema, and Go SDK
  • Added a Stack Switch in the QuerySettingsEditor
  • Updated getTimeSeries() in data-transform.ts to prefer the per-query stack flag over the global visual.stack === 'all' when set
  • Moved getCommonTimeScale and getTimeSeriesValues imports from @perses-dev/components to @perses-dev/core

Open question:

The drawing order of stacked series depends on the order queries are defined. This could be relevant now since time series can overlap. But if they are not stacked it's the same. So just a thought. A dedicated zIndex field in QuerySettingsOptions could give explicit control over this - though it only matters at higher opacity values anyway.

Also in Grafana / Plutono the Stacking Option is a boolean. I didn't want to adjust that since that would be a breaking change, but might also be something to consider.

Screenshots

Query 1 excluded from stacking

Query 1 excluded from stacking.

Query 1 included again in stacking

Query 1 included again in stacking.

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.

Signed-off-by: Markus Wieland <markus.wieland@sap.com>
@SoWieMarkus SoWieMarkus requested review from a team, AntoineThebaud and Nexucis as code owners June 5, 2026 14:30
@SoWieMarkus SoWieMarkus requested review from jgbernalp and removed request for a team June 5, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant