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

[Kibana Lens] possibility to color cells of a table based on the value of another field and not the displayed field #205087

Open
Danouchka opened this issue Dec 23, 2024 · 2 comments
Labels
Feature:Data Table Data table visualization feature Feature:kibana-react Feature:Lens Charts Security Solution Lens Charts feature Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@Danouchka
Copy link

Describe the feature:
In Lens table, the cells can be colored only according the displayed metrics and colors can be set only against positive numbers or percentages
In this feature requests, my customer would like to have cells colored against a secondary metric and allow coloration according values of secondary metrics including negative values.

Describe a specific use case for the feature:
We have the following dataset

POST mytestindex/_doc
{
    "name":"TOTO1",
    "@timestamp":"2024-12-14T23:23:00.000Z",
    "nb_alerts":59,
    "nb_alerts_ref":60
}
POST mytestindex/_doc
{
    "name":"TOTO1",
    "@timestamp":"2024-12-14T23:24:00.000Z",
    "nb_alerts":60,
    "nb_alerts_ref":60
}
POST mytestindex/_doc
{
    "name":"TOTO1",
    "@timestamp":"2024-12-14T23:25:00.000Z",
    "nb_alerts":61,
    "nb_alerts_ref":60
}
POST mytestindex/_doc
{
    "name":"TOTO1",
    "@timestamp":"2024-12-14T23:26:00.000Z",
    "nb_alerts":2,
    "nb_alerts_ref":60
}

In Lens we can represent this with the following table
Image

Imagine we add a diff runtime fields with the formula

if (doc['nb_alerts'].size()>0 && doc['nb_alerts'].value > 0) {
    emit((double)(doc['nb_alerts'].value - doc['nb_alerts_ref'].value));
}

The goal is to color

  • the cell with 59 in red because diff=-1<0
  • the cell with 60 in green because diff=0>=0
  • the cell with 61 in darker green because diff=1
  • the cell with 2 in stronger red because diff=-58 ..etc

Thank you

@botelastic botelastic bot added the needs-team Issues missing a team label label Dec 23, 2024
@Danouchka Danouchka added Feature:Data Table Data table visualization feature Feature:Lens Feature:Lens Charts Security Solution Lens Charts feature and removed needs-team Issues missing a team label labels Dec 23, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Dec 23, 2024
@Danouchka Danouchka added Feature:kibana-react and removed Feature:Data Table Data table visualization feature Feature:Lens needs-team Issues missing a team label Feature:Lens Charts Security Solution Lens Charts feature labels Dec 23, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Dec 23, 2024
@Danouchka Danouchka added Feature:Data Table Data table visualization feature Feature:Lens Feature:Lens Charts Security Solution Lens Charts feature labels Dec 23, 2024
@Danouchka
Copy link
Author

cc @teresaalvarezsoler @ghudgins

@bhavyarm bhavyarm added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Dec 23, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Table Data table visualization feature Feature:kibana-react Feature:Lens Charts Security Solution Lens Charts feature Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants