-
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] For very small values XY axis can get many many zeros #143750
Comments
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
I'm not sure whether this is a Kibana or an elastic-charts bug - don't we have some logic in place to extend the axis in these situations to get different ticks @markov00 ? Maybe I'm misremembering... |
marking as blocked for now until @markov00 had the chance to check it out :) |
This is caused by your formatting function used. numeral(0.01).format('0.[00]'); // === 0.01
numeral(0.001).format('0.[00]'); // === 0
numeral(0.0000001).format('0.[00]'); // NaN and in this case I think the code instead renders the number with a simple toString 1e-7 I don't think we should remove the duplicate zeros internally in charts, instead, we should take back ownership of the axis tick formatting and deliver the optimal representation every time. We should use the field formatters only in the tooltip, where the user requires the a particular precision. We could just provide a way to define prefix/postfix or the type of notation to use when formatting the axes values. |
Yeah, that's the bigger plan here. I think it makes sense to just block it on that for now. |
Thanks for taking a look! |
what do you mean? that we should the deduplication feature in elastic charts? I'm more on the idea to fix the field formatter logic in this case. |
Sorry, didn't state that clearly. I meant rewriting the formatting so we don't get a blackbox number formatter based on numeral.js but a config object based on a standard that can be used more intelligently by all the places applying it: #102239 |
Describe the bug:
Divide a value by a very number in Lens (i.e. in formula with
1/BIG NUMBER HERE
) to see the Y axis act in a weird way with the formatting.I've discovered this while testing #143632 and later reproduced with static values.
Expected behavior:
Avoid 0 duplicates - it's strange that the precision increases up to a point where it gets reduced to a simple
0
In general a better formatting strategy for this cases should be found.
The text was updated successfully, but these errors were encountered: