How to add a row as an exception to threshold values?

I have a table where I have set some thresholds and anything greater than 10% - the cell color will change to red, is there any way to add an exception to this rule for a particular row ?

For that particular row I am okay with anything greater than 10% but due to threshold configured that cell also appears in red background.

I want threshold to work on all other rows except one, is there any way to do it ?

Hi @adityavermamanit,

I think the Value Mapping option fits your case. If you haven’t yet check the documentation regarding it then here is the link.

You can define many options e.g. in your case a Value to appear in a particular color (and can define ranges too).

I hope this helps.

Appreciate the quick response, and yes I am aware of the value mapping option but I don’t think it will help in my use case.

Let say I add value mapping for that field, then it will apply to all the rows in that field, but I still want the other rows to change color according to the threshold set for that field.

The particular row where I don’t want the thresholds to be applied is not having a static value so I can’t map it to a specific value in value mapping and if I give range it will affect other rows

What panel visualisation you are using and what is your data source?

Infinity is the data source and panel is just table

what would be the exception for that row that would override the override :eyes:

Didn’t get it, what do you mean ?

This ^
what is the exception you talk about? Can please provide sample csv data that shows exception of a particular row. Talking in hypotheticals is very hard to work with

Say there are 4 rows, lets say the value of each row a given field F is as following:

___|_F__
R1 | 80
R2 | 20
R3 | 50
R4 | 60

Now I added threshold and colors, so that any cell in field F > 40 will be red, so R1, R3, R4 becomes red. But I don’t want R1 to become red, how do I add this exception, so that thresholds applies to all other rows in that field F but not to R1 ?

1 Like

Was it helpful @yosiasz or let me know if you need any other details

Well there has to be a rule right? What is the rule that 80 should not be red? Because once you configure such it will apply the rule dynamically.

Unless this can be done via jsonata in case your data source is json from rest api

Rule is if it’s not R1 then thresholds should apply.

R1 = when value in any row in the first column is R1

this is the closes using Overrides value mapping, not sure how it can do it for whole row as value mapping is per cell

@yosiasz , could you please share some more details as how exactly you were able to achieve it (maybe some screenshots of the steps OR a even better a small GIF) ?

here is the json model :wink:

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 15,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "yesoreyeram-infinity-datasource",
        "uid": "c6l_dV74k"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "red",
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "color-background-solid",
            "inspect": false
          },
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "F"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "from": 40,
                      "result": {
                        "color": "dark-red",
                        "index": 0
                      },
                      "to": 100000
                    },
                    "type": "range"
                  }
                ]
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Z"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "R1": {
                        "color": "dark-blue",
                        "index": 0
                      }
                    },
                    "type": "value"
                  }
                ]
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 18,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "9.1.5",
      "targets": [
        {
          "columns": [
            {
              "selector": "Z",
              "text": "",
              "type": "string"
            },
            {
              "selector": "F",
              "text": "",
              "type": "number"
            }
          ],
          "csv_options": {
            "delimiter": "|"
          },
          "data": "Z|F\nR9|10\nR1|80\nR2|20\nR3|50\nR4|60",
          "datasource": {
            "type": "yesoreyeram-infinity-datasource",
            "uid": "c6l_dV74k"
          },
          "filters": [],
          "format": "table",
          "global_query_id": "",
          "refId": "A",
          "root_selector": "",
          "source": "inline",
          "type": "csv",
          "url": "https://jsonplaceholder.typicode.com/users",
          "url_options": {
            "data": "",
            "method": "GET"
          }
        }
      ],
      "title": "Panel Title",
      "type": "table"
    }
  ],
  "schemaVersion": 37,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Color Exceptions",
  "uid": "Kit0VMv4k",
  "version": 7,
  "weekStart": ""
}

Yeah I think it is not possible through value mapping, so in your screenshot, what I am trying to achieve is to have 80 in green

I am not sure if it is possible as it is cell level . wish there was row level overrides

Unless this is possible with apache echarts grafana plugin

@mikhailvolkov

You may be able to do it with ECharts. I would recommend looking at Dynamic Text Panel: Dynamic Text plugin for Grafana | Grafana Labs

It allows to display of values in the custom table and customizes the look and feel using markdown, HTML, and handlebars.

1 Like

Appreciate the reply @mikhailvolkov - I am gonna accept this as solution. I think what I wanted I can get pretty close to it using this, ofc the overhead would be to use HTML and stuff.

1 Like

@adityavermamanit Give it a try, and let us know if you have any questions in the GitHub repository.