-
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
[Lens] Don't use auto interval to get interval for single bar #64502
Conversation
80c7745
to
93b1289
Compare
93b1289
to
bb8cd9a
Compare
Pinging @elastic/kibana-app (Team:KibanaApp) |
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.
I just tested a little and this fix doesn't work anymore when the user is selecting a custom interval.
For example, if the custom interval is larger than the configured time range, no bar is shown as well:
Vislib vis types can deal with the situation
I guess this happens because in this case the bucket starts before the min
value of the x domain, and because the minInterval
calculation doesn't come close to the actual value (because it's simulating the auto behavior) it renders the bar off-screen to the left.
I suggest we solve this now by doing a hybrid of the old behavior and the approach in this PR - if the meta
object contains an actual interval, use it. Otherwise fall back to the logic with guessing the interval. I'm getting more and more convinced that in the long-term the data table should contain this information.
@flash1293 Thank you for cautiousness! I tested it on 7.6.1 and looks like we have the bug there too 😭 Nevertheless, I agree, this probably makes things even worse so I'll add a correction. I submitted an issue: #64544 |
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.
In this case I’m going to approve, we can solve the other bug separately. Maybe it even requires an elastic-charts fix, let’s see.
I agree with @flash1293 about this entire comment:
I also agree @mbondyra that the bug with intervals larger than the time range should be dealt with separately. |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
#64784) * feat: don't use auto interval to get interval for single bar * fix: fixing non auto intervals Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This is a proposal of solution of the following problem:
Charts are not able to calculate an interval for a chart with a single bar to display proper width of it. Right now we're passing minInterval from aggsConfig interval param, but it'll be removed with the PR: #63874
What I am proposing is to calculate the approximate interval with a simplified method of what we do for auto interval and as it's an edgecase, I don't think we need a big precision.
Checklist
Delete any items that are not applicable to this PR.
For maintainers