Skip to content
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

Metric progress bar fallback color should be unique #172235

Closed
nickofthyme opened this issue Nov 30, 2023 · 4 comments
Closed

Metric progress bar fallback color should be unique #172235

nickofthyme opened this issue Nov 30, 2023 · 4 comments
Labels
Feature:Lens Feature:MetricVis Metric visualization feature Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@nickofthyme
Copy link
Contributor

nickofthyme commented Nov 30, 2023

Describe the feature:

When using the Lens Metric chart with color ranges, where the primary value of the metric is below the max value, the getColor function returns undefined and defaults to the same color as the metric background. This ends up looking like extra padding on the left side of the metric.

Thus there is little indication to the user that the value is actually beyond the color range domain.

Screen Recording 2023-11-29 at 05 28 44 PM

Notice as the max value is increased, the values eventually become less than the max and scale properly, but when the values are greater than the max the default color (also the background color) is used.

Code is here:

color:
config.metric.palette && value != null
? getColor(
value,
config.metric.palette,
{
metric: primaryMetricColumn.id,
max: maxColId,
breakdownBy: breakdownByColumn?.id,
},
data,
rowIdx
) ?? defaultColor
: config.metric.color ?? defaultColor,

Describe a specific use case for the feature:
I think a possible solution to this is to default to the min/max value if the value is out of the color range. This would look like this...

Screen Recording 2023-11-29 at 05 50 36 PM

Another option would be to make the default bar color show as a darker default different than the Metric background. This would look like...

Screen Recording 2023-11-29 at 05 44 54 PM

We could build this default color selection into the editor panel.

image

CC: @markov00 @gvnmagni @drewdaemon

@nickofthyme nickofthyme added Feature:MetricVis Metric visualization feature Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Nov 30, 2023
@elasticmachine
Copy link
Contributor

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

@markov00
Copy link
Member

hi @nickofthyme I'm not fully sure I understand the problem here. I've tested main and I can't replicate the specified behaviour.

Does it happens only under specific conditions, like only with static maximum value or formula?

@nickofthyme
Copy link
Contributor Author

Oh yeah you're right, I only see the issue in this one case. Let me dig a bit deeper and see what's causing it.

@nickofthyme
Copy link
Contributor Author

Closing in favor of #172297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens Feature:MetricVis Metric visualization feature Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants