-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(mixed-timeseries-plugin): Second query stacks stacked on top of first query series #29119
Conversation
…irst query series
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a general comment about composite keys.
@@ -225,6 +227,9 @@ export function transformSeries( | |||
} else if (stack && isTrend) { | |||
stackId = getTimeCompareStackId(forecastSeries.type, timeCompare, name); | |||
} | |||
if (stackId && stackIdSuffix) { | |||
stackId += stackIdSuffix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a nit, but a cybersec person once said that you should always use \n
as the separator in composite keys in cases where it's unlikely to appear naturally in the original keys. I'm not sure there's lots of collision risk here, but just in case I'd probably use \n
instead of _
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 🙂
SUMMARY
In Mixed Series chart, when user sets "Stack" option to true for both queries, the series of the second query are stacked on top of the series of the first query. The reason for that is that both queries could have the same stack ids.
This PR introduces
stackIdSuffix
, which adds_a
and_b
suffixes to stack ids of queries A and B to ensure that they're unique.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
In the screenshots - the bars represent the second query. Before, they were stacked on top of the series from 1st query.
Before:
After:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION