Table - Gauge - Element - Displaying does not work as intended

  • What Grafana version and what operating system are you using?
    MacOS, 13.3 with Safari and Microsoft Edge
    Grafana 9.4.7 Community Edition

  • What are you trying to achieve?
    I have absolute values and percentage values in one table panel.
    The percentage value is in total 100% and can shift between 0% and 100%. 50% means neutral.
    I want to display the bias of Short and Long positions for financial stock market data.

  • How are you trying to achieve it?
    I set up view in the local database and connected it with the table panel.
    I used the override feature to apply the cell type “Gauge” to the percentage value.

  • What happened?
    The optical representation was only one / two pixel on the left of the bar no matter if the Bias was at 10% or 90%.
    When clicking “replacing all fields”, the gauge looked better. But I like to have values and optical support.

Assumption: As there are absolute and percentage values on the same line, Grafana sets a value of 0.8 (for 80%) into the scale of absolute values like 185,432.

  • What did you expect to happen?
    I wanted to see the bias as the following:
  • When above 50: moving from the middle of the bar to the right with thresholds of different green intensity.
    . When below 50: moving from the middle of the bar to the left with several levels of red.

  • Can you copy/paste the configuration(s) that you are having problems with?
{
  "datasource": {
    "uid": "000000006",
    "type": "mysql"
  },
  "fieldConfig": {
    "defaults": {
      "custom": {
        "align": "auto",
        "cellOptions": {
          "type": "auto"
        },
        "inspect": false
      },
      "mappings": [],
      "thresholds": {
        "mode": "absolute",
        "steps": [
          {
            "color": "semi-dark-blue",
            "value": null
          }
        ]
      },
      "color": {
        "mode": "thresholds"
      },
      "unit": "locale"
    },
    "overrides": [
      {
        "matcher": {
          "id": "byName",
          "options": "NC Long (%)"
        },
        "properties": [
          {
            "id": "unit",
            "value": "percentunit"
          },
          {
            "id": "decimals",
            "value": 0
          },
          {
            "id": "custom.width",
            "value": 122
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "NC Short (%)"
        },
        "properties": [
          {
            "id": "unit",
            "value": "percentunit"
          },
          {
            "id": "decimals",
            "value": 0
          },
          {
            "id": "custom.width",
            "value": 129
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "Com. Long (%)"
        },
        "properties": [
          {
            "id": "unit",
            "value": "percentunit"
          },
          {
            "id": "decimals",
            "value": 0
          },
          {
            "id": "custom.width",
            "value": 117
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "Com. Short (%)"
        },
        "properties": [
          {
            "id": "unit",
            "value": "percentunit"
          },
          {
            "id": "decimals",
            "value": 0
          },
          {
            "id": "custom.width",
            "value": 87
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "Com. Long"
        },
        "properties": [
          {
            "id": "custom.width",
            "value": 176
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "Markt"
        },
        "properties": [
          {
            "id": "custom.width",
            "value": 83
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "NC Long"
        },
        "properties": [
          {
            "id": "custom.width",
            "value": 93
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "NC Short"
        },
        "properties": [
          {
            "id": "custom.width",
            "value": 117
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "NC Gesamt"
        },
        "properties": [
          {
            "id": "custom.width",
            "value": 100
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "Com. Short"
        },
        "properties": [
          {
            "id": "custom.width",
            "value": 107
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "Com. Gesamt"
        },
        "properties": [
          {
            "id": "custom.width",
            "value": 132
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "CoT-Datum"
        },
        "properties": [
          {
            "id": "unit",
            "value": "time:DD.MM.YYYY"
          },
          {
            "id": "custom.align",
            "value": "center"
          },
          {
            "id": "custom.width",
            "value": 116
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "Markt"
        },
        "properties": [
          {
            "id": "links",
            "value": [
              {
                "title": "",
                "url": "https://grafana.trading.meinzuhau.se/d/_5k03OlVk/03-9-cot-daten-veranderung-historie?orgId=2&grafana_commodity=${__idCommodity}"
              }
            ]
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "idCommodity"
        },
        "properties": [
          {
            "id": "custom.hidden",
            "value": true
          }
        ]
      },
      {
        "matcher": {
          "id": "byRegexp",
          "options": ".+\\sBias"
        },
        "properties": [
          {
            "id": "unit",
            "value": "percentunit"
          },
          {
            "id": "custom.cellOptions",
            "value": {
              "type": "gauge",
              "valueDisplayMode": "color"
            }
          }
        ]
      }
    ]
  },
  "gridPos": {
    "h": 24,
    "w": 24,
    "x": 0,
    "y": 0
  },
  "id": 2,
  "options": {
    "showHeader": true,
    "cellHeight": "sm",
    "footer": {
      "show": false,
      "reducer": [
        "sum"
      ],
      "countRows": false,
      "fields": []
    },
    "sortBy": []
  },
  "pluginVersion": "9.5.3",
  "targets": [
    {
      "datasource": {
        "type": "mysql",
        "uid": "000000006"
      },
      "dataset": "trading",
      "editorMode": "builder",
      "format": "table",
      "rawQuery": true,
      "rawSql": "SELECT commodity_shortsign AS \"Markt\", noncom_long AS \"NC Long\", noncom_short AS \"NC Short\", noncom_total AS \"NC Gesamt\", noncom_long_pct AS \"NC Long (%)\", noncom_short_pct AS \"NC Short (%)\", com_long AS \"Com. Long\", com_short AS \"Com. Short\", com_total AS \"Com. Gesamt\", com_long_pct AS \"Com. Long (%)\", com_short_pct AS \"Com. Short (%)\", cot_date AS \"CoT-Datum\", com_bias AS \"Com Bias\", noncom_bias AS \"NC Bias\" FROM trading.Grf_Cot_Weekly_Change_with_ComSpreads LIMIT 50 ",
      "refId": "A",
      "sql": {
        "columns": [
          {
            "alias": "\"Markt\"",
            "parameters": [
              {
                "name": "commodity_shortsign",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"NC Long\"",
            "parameters": [
              {
                "name": "noncom_long",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"NC Short\"",
            "parameters": [
              {
                "name": "noncom_short",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"NC Gesamt\"",
            "parameters": [
              {
                "name": "noncom_total",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"NC Long (%)\"",
            "parameters": [
              {
                "name": "noncom_long_pct",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"NC Short (%)\"",
            "parameters": [
              {
                "name": "noncom_short_pct",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"Com. Long\"",
            "parameters": [
              {
                "name": "com_long",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"Com. Short\"",
            "parameters": [
              {
                "name": "com_short",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"Com. Gesamt\"",
            "parameters": [
              {
                "name": "com_total",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"Com. Long (%)\"",
            "parameters": [
              {
                "name": "com_long_pct",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"Com. Short (%)\"",
            "parameters": [
              {
                "name": "com_short_pct",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"CoT-Datum\"",
            "parameters": [
              {
                "name": "cot_date",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"Com Bias\"",
            "parameters": [
              {
                "name": "com_bias",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          },
          {
            "alias": "\"NC Bias\"",
            "parameters": [
              {
                "name": "noncom_bias",
                "type": "functionParameter"
              }
            ],
            "type": "function"
          }
        ],
        "groupBy": [
          {
            "property": {
              "type": "string"
            },
            "type": "groupBy"
          }
        ],
        "limit": 50
      },
      "table": "Grf_Cot_Weekly_Change_with_ComSpreads"
    }
  ],
  "title": "CoT-Daten - Marktübersicht",
  "transformations": [
    {
      "id": "organize",
      "options": {
        "excludeByName": {},
        "indexByName": {
          "CoT-Datum": 1,
          "Com. Gesamt": 9,
          "Com. Long": 8,
          "Com. Long (%)": 10,
          "Com. Short": 7,
          "Com. Short (%)": 11,
          "Markt": 0,
          "NC Gesamt": 4,
          "NC Long": 3,
          "NC Long (%)": 5,
          "NC Short": 2,
          "NC Short (%)": 6,
          "idCommodity": 12
        },
        "renameByName": {}
      }
    }
  ],
  "type": "table"
}
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

No.