[ENHANCEMENT] timeserieschart: add per-query stack override#670
Open
SoWieMarkus wants to merge 4 commits into
Open
[ENHANCEMENT] timeserieschart: add per-query stack override#670SoWieMarkus wants to merge 4 commits into
SoWieMarkus wants to merge 4 commits into
Conversation
Signed-off-by: Markus Wieland <markus.wieland@sap.com>
There was a problem hiding this comment.
Pull request overview
Adds a per-query stack?: boolean override to the Time Series Chart plugin so individual queries can opt in/out of stacking regardless of the global visual stacking setting, and wires this through the model + UI + series transformation logic.
Changes:
- Extends query settings (TS model, CUE schema, Go SDK) with
stack?: boolean. - Adds a Stack override control to the Query Settings editor.
- Updates series generation to prefer per-query stack override over global
visual.stack.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| timeserieschart/src/VisualOptionsEditor.tsx | Minor adjustment in visual stack option update line. |
| timeserieschart/src/utils/data-transform.ts | Implements per-query stack override logic in getTimeSeries() and moves getCommonTimeScale import. |
| timeserieschart/src/TimeSeriesChartPanel.tsx | Moves getTimeSeriesValues import to @perses-dev/core. |
| timeserieschart/src/TimeSeriesChartBase.tsx | Moves getCommonTimeScale import to @perses-dev/core. |
| timeserieschart/src/time-series-chart-model.ts | Adds stack?: boolean to QuerySettingsOptions. |
| timeserieschart/src/QuerySettingsEditor.tsx | Adds Stack override UI (Switch) and plumbing for query settings updates. |
| timeserieschart/sdk/go/time-series.go | Adds stack field to Go SDK query settings struct. |
| timeserieschart/schemas/time-series.cue | Adds stack?: bool to the CUE schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
75
to
96
| @@ -90,7 +92,7 @@ export function getTimeSeries( | |||
| datasetIndex, | |||
| name: formattedName, | |||
| color: paletteColor, | |||
| stack: visual.stack === 'all' ? visual.stack : undefined, | |||
| stack: shouldStack ? 'all' : undefined, | |||
| yAxisIndex: yAxisIndex, | |||
Contributor
There was a problem hiding this comment.
@SoWieMarkus, I can also confirm that the tooltip is not working anymore when it is stacked after your changes. I tested manually.
ibakshay
requested changes
Jun 12, 2026
Co-authored-by: Akshay Iyyadurai Balasundaram <akshay.iyyadurai.balasundaram@sap.com> Signed-off-by: Markus Wieland <44964229+SoWieMarkus@users.noreply.github.com>
Co-authored-by: Akshay Iyyadurai Balasundaram <akshay.iyyadurai.balasundaram@sap.com> Signed-off-by: Markus Wieland <44964229+SoWieMarkus@users.noreply.github.com>
Co-authored-by: Akshay Iyyadurai Balasundaram <akshay.iyyadurai.balasundaram@sap.com> Signed-off-by: Markus Wieland <44964229+SoWieMarkus@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds a per-query
stackoverride 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:
stack?: boolfield toQuerySettingsOptionsin the model, CUE schema, and Go SDKStackSwitch in theQuerySettingsEditorgetTimeSeries()indata-transform.tsto prefer the per-querystackflag over the globalvisual.stack === 'all'when setgetCommonTimeScaleandgetTimeSeriesValuesimports from@perses-dev/componentsto@perses-dev/core(because not available in@perses-dev/components? Can revert that change ofc)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
zIndexfield inQuerySettingsOptionscould 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 included again in stacking.
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes