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

[Lens] Coloring problem on multi metric partition chart #151006

Closed
stratoula opened this issue Feb 13, 2023 · 2 comments · Fixed by #151949
Closed

[Lens] Coloring problem on multi metric partition chart #151006

stratoula opened this issue Feb 13, 2023 · 2 comments · Fixed by #151949
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@stratoula
Copy link
Contributor

Kibana version:
8.7

Describe the bug:
This #145948 enabled manual coloring on a partition chart that has more than 1 metric.
If I color one metric with a custom color and then change the function of the other metric, the color is lost.

Steps to reproduce:

  1. Create a donut with an average and a median
  2. Give to the median a custom color
  3. Change the average to last value
  4. Check the colors

lens

A similar weird behavior happens when I have 2 metrics with the automatic colors. If I change the function of one the colors swap causing inconsistency among the chart and the dimension panel

lens
image

Expected behavior:
Colors should not change like that and should be consinstency among the colors depicted on the chart and on the dimension panel.

@stratoula stratoula added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Feb 13, 2023
@elasticmachine
Copy link
Contributor

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

@drewdaemon drewdaemon self-assigned this Feb 21, 2023
@drewdaemon drewdaemon changed the title [Lens] Coloring problem on multi slice partition chart [Lens] Coloring problem on multi metric partition chart Feb 21, 2023
@drewdaemon
Copy link
Contributor

drewdaemon commented Feb 21, 2023

Some research:

The crux of the problem seems to be that the palette getCategoricalColor method is called with a different rankAtDepth value in the renderer than it is in the dimension editor/triggers. This seems to occur because the renderer takes the liberty of sorting the dimensions by slice size, whereas the visualization-controlled components are just using the existing dimension order.

In the example in the issue, changing the function to Last value changes the slice order changing that dimensions rankAtDepth from 0 to 1 in the expression renderer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants