-
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
Axis renders incorrectly for negative values with "Duration" Value format #196214
Comments
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
Hey @garethhumphriesgkc thanks for posting this issue. The only way I can recreate this is by creating a vis with extremely small values relative to the unit being used so in this case I could show a chart with extends from But in reality it's just that the values formatted in an imprecise way using a unit orders of magnitude larger than the values being visualized. So the example above if I were to increase the precision using the With that said, I'm curious what are is the extents of your dataset y values when you see this issue and if the case above explains that. With that said, we do display the same formatted axis label which is incorrect. We do not account for this when rendering the charts so in a way it's up to the user at this point to prevent this as best as possible. We have #170154 to improve this by separating the axis and data formatters. We have also discussed ways to verify a value is the true and precise value, where if I pass you Finally, we could de-duplicate extract ticks that are the same but we don't always know which ticks are the accurate one. This also has the drawback of removing the sense of scale from the user. For example, imagine the fist chart I posted and removing the As for this comment...
This is not always the case, durations on their own are simply scalar values and do not always imply direction. You could be trying to visualize the change in request latency over time. In this case the But you are right, this is sometimes the case, which is why we provide the |
I've just done another repro - as simple as I can. Steps were:
I get the same behaviour. Interestingly, however, I don't get it for any of the other "To" options - it seems it's limited to "Friendly (precise)". I didn't start from scratch last time, so didn't notice this step was required - sorry. I've also noticed that sometimes it doesn't matter what the "Convert" is set to at all. Both the axis and tooltip always report values in ms when:
While digging deeper, I've also noticed some serious discrepencies in the the charted point as opposed to the values when using the precise mode with "Convert" set to milliseconds or higher, which I don't see with the other modes. Observe below screenshots, which all use the same data - firstly notice the original axis issue this ticket was raised about on the second set, but also notice in the second set that the tooltip values are quite incorrect compared to the bars that supposedly represent them. Friendly (approximate) - first four values: Compare to Friendly (precise) - first four values: The values for the first ten bars here are:
Notes:
As soon as the
This matches all other "To" modes (both positive and negative) and looks much closer to the actual bar lengths (although there are 15 different lenth bars all claiming to be "4 minutes", so "precise" has a somewhat fuzzy definition). In summary, negative values used for a duration with millisecond or higher precision aren't calculated correctly in "Friendly (precise)" output mode. |
Attempting to reproduce this with your updated steps, using an Zight.Recording.2024-10-17.at.12.42.28.PM.mp4
Expand for data used
Could you provide me a few things so I can try to figure this out? First thing would be to share the response from the Inspect tab. See recording below for how to get this... Zight.Recording.2024-10-17.at.12.50.38.PM.mp4The second thing would be the saved object of the dashboard. See video of how to do this below, also make sure the Include related objects option is enabled before exporting. Ideally this dashboard has just the problematic visualization. Zight.Recording.2024-10-17.at.12.54.45.PM.mp4Warning Please be sure to remove/replace any personal data you do not wish to share publicly. |
Hi, Please see attached data:
I loaded the data in load.tsv in to a brand new index, followed the steps outlined, and got the unexpected behaviour. I also loaded it into an 8.15.1 cluster and did not get the same behaviour - so it appears to be limited to either 8.12.1 or some other configuration unique to this cluster (but not this index). I will continue looking for more discrepencies. Note that there is a runtime field in the request which is an obvious candidate for testing - this was absent in the test index and I still saw the issue, so have eliminated it as a cause. |
|
Kibana version:
8.12.1
Elasticsearch version:
8.12.1
Server OS version:
Ubuntu 24.04
Browser version:
Chrome 129.0.6668.90
Browser OS version:
Windows 10
Original install method (e.g. download page, yum, from source, etc.):
deb
Describe the bug:
When a Lens visualisation has a dimension which has been configured to be of Value format "Duration", and the chart goes in to negative space, the axis doesn't render values less than 0. The chart itself renders fine, just the axis values are incorrect.
Refer screenshot below.
Steps to reproduce:
0-<field.name>
)Expected behavior:
Correct values display. Arguably in friendly mode the string "ago" should be appended, but at the least the numbers displayed should reflect the actual values at that horizontal.
Screenshots (if relevant):
Errors in browser console (if relevant):
Provide logs and/or server output (if relevant):
Any additional context:
The text was updated successfully, but these errors were encountered: