-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[TSVB] Add option to stack globally or within series #31417
Conversation
💔 Build Failed |
retest |
💔 Build Failed |
💚 Build Succeeded |
It feels a bit dirty to add this check to the flot code itself. The documentation says
This can be achieved by changing line 24 in However I'm not 100% sure whether this has some unintended side effects (pinging @timroes @ppisljar ) |
@flash1293 thanks for a review. |
@sulemanof and me looked into this via zoom and my proposed fix does the same thing as his, just in another place. The question remains whether this is the desired behaviour - if we add this, it won't be possible anymore to stack different series on top of each other. IMHO there is an argument for that because different series can be different metrics (e.g. average or count) and use different chart types (e.g. bar chart and line chart) which looks kind of strange and shouldn't be able to be stacked in the first place - kind of protecting the user from what they don't want to do in the first place and enabling them to do what the most probably wanted to do (stacking sub series for each series individually). However this is a breaking change and maybe some users are depending on this. Another solution would be to make this behaviour configurable (a checkbox next to "Stacked" where you can enable "Only stack inside of the series"). EDIT: The more I think about this I think we should go with the configurable option. Any thoughts on this @timroes @markov00 @sulemanof ? |
💚 Build Succeeded |
Just talked to Joe about that behavior. I would second the suggestion that Joe made:
It should be rather simple to implement that in Do you think that would make sense, @sulemanof ? |
I suppose it makes sense! In such case it will be safety for existing visualizations! |
@sulemanof will you implement this directly on this PR or should we close this one and add a dedicated issue for the new feature? |
I think it makes sense to implement it in the existing PR |
💔 Build Failed |
retest |
💚 Build Succeeded |
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.
Tested in Chrome Linux. Seems to work as expected. Code LGTM
Pinging @elastic/kibana-app |
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.
Code LGTM
* Add a check for the same series metric * Replace logic to the nodejs side * Add 'Stack within series' option
Fix #15543 .
The main idea is to change stack behavior in a plot depending on a particular series.
I suppose stack should only depends on the other data in the same series, and should not depend on others series (how it works currently).
The existing behavior is: =>
Configure 2 same series:
Add a bucket script to the second metric to mirror results:
The plot will look like: (1)
Set stacked to negative metrics, the plot will look like: (2)
Set stacked to positive metrics (in this case all series are stacked), the plot will look a bit frustrated: (3)
Furthermore, now it depends on a position of the first series. It means that if we change the position conversely, the plot will look like: (4)
Proposal solution:
The fix will not bring breaking changes into a plot (plots (1) and (2) will remain the same), but it will depends on a particular series now (both series are stacked, but do not depend on each other):