-
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] [Discuss] Which formatters should Lens support? #53535
Comments
No matter which ones we use out of the box, they should easily just be a single select with the option to customize (show the formatter input). |
For specifically numeric formatting, we could also look at how TSVB does it, which is to have a list of format options followed by "custom" Also, date formatting has its own issues and I have a separate issue to talk about one of the potential improvements: #51227 |
Pinging @elastic/kibana-app (Team:KibanaApp) |
I think it would be really nice to have a "level of precision" display for numbers and percentages |
As the first phase (7.6), I suggest having specific selection of formatters only for the metric visualized (not for the axis) without the ability to go custom using selected formatters. These will include several options that will likely fit 80%+ of the needs:
Next step after 7.6 |
I like the idea of taking specific common formatters and putting them in a dropdown menu. That will help with a lot of the common cases. Currency and numbers already use the So two questions:
|
I could see this being a chart-wide option not a per-dimension configuration. Though if the index pattern has this information stored in it, we should use that as default. Example A user can change the whole locale for the entire chart in the chart settings (yet to be implemented) Which then the options for currency formatting for the dimension would inherit via the "Auto" option, or the user can manually select any other currency for that dimension. |
The existing default formatters are good. Three-digit is a good default when there is a fraction. if users want to see more/less characters after the decimal point they can change it by selecting one of the formatters:
Regarding local I'm thinking not in the first phase here. Depends on the requests we will get, we can add it later or have that as part of the ability to customize using numerals or other library |
An update on this: I have been working on the pre-requisite change to let users have access to these formatters for any index pattern, and then we can use those formatters in Lens too. The new formatters will let users choose the number of decimal places for numbers and percentages. They also support locale selection and currency selection from a list, and there is a new "short number" formatter for thousands/millions. Given the designs above, it seems like we prefer showing users a limited set of options in a single menu, instead of having extra dropdowns appear conditionally. To compare, which do you prefer?
vs
Which is preferable? |
If we can make option two on time for 7.6 (if not I prefer to set a limit number of formats and move on) then let's go with option two, which is be more flexible. For option two these are the groups the way I see them with the default and the configuration options which becomes available once the format is selected
The Quick ugly mockup with the options and examples for the drop down and default state This is @cchaos much nicer mockup suggestion |
I think individual currencies can still be displayed in the full Format list just with a specific heading. As shown here: What this also shows is the top 5 currencies that @AlonaNadler mentioned and an eventual "More" button. Once we are able to add more currencies, we can just have a "More button" which will then be the full list of global currencies. Decimals can apply to any of the formats above therefore it is it's own field though visually grouped with Format: |
I'm going to close this issue because I think we have made a decision about the general approach to how Lens will use formatters. In summary: Lens defines a custom set of formatters which use the Field Formatters as an implementation detail. To give an example of how this works:
|
Lens should allow users to set a formatter for a specific aggregation or metric. It already uses the default field formatters provided from the index pattern if those data points are set, and those defaults should allow overriding.
This issue is to discuss how Lens should let users format data.
In Kibana today, formatters have a
type
and potentially some extra arguments. For example, thenumber
formatter takes a format string. Thedate
formatter also takes a format string.For reference, here are the current formatting options for index patterns in Kibana:
The text was updated successfully, but these errors were encountered: