elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.48k stars 8.05k forks source link

Axis tick label formatter independent from the data value formatter #170154

Open nickofthyme opened 8 months ago

nickofthyme commented 8 months ago

Describe the feature:

As a user, I'd like a way to independently format the values in the chart vs the axis tick value labels. Currently in Lens, we only allow for the user to set the value format at the data level. This limits the users ability to format the axis without impacting how the data values are displayed in the tooltip and/or legend.

This formatting option would be added to the existing axis options.

Lens - Elastic 2023-10-30 at 9 19 18 AM

To avoid changes to existing visualizations, this option would be disabled by default. Also the actual formatting option would be different between time-based axes, especially multi-layer time axes, and numerical or categorical axes. Possibly for the first pass just disable this axis formatting altogether on time-based axes.

Describe a specific use case for the feature: A use case would be a user that wants to round the axis ticks is a way to declutter and reduce the number of ticks, but not alter the accuracy of the individual data values in the chart.

Screen Recording 2023-10-30 at 09 17 57 AM

Related to #172429 170151

elasticmachine commented 8 months ago

Pinging @elastic/kibana-visualizations (Team:Visualizations)

markov00 commented 3 months ago

This is similar to what happen in Gauge where we want the axis format to be independent from the main displayed value format.

I strongly believe that the axis should just bring the minimal amount of "rounded" information, so compact values and just in case a suffix (that can probably be appended somewhere in the axis and not repeated on every tick), and only decimals if they are needed. Then the value in the tooltip, metric,or anyway the visible one could be formatted as the user prefer