-
What Grafana version and what operating system are you using?
Grafana 12.0.1 on Debian 12.11 -
What are you trying to achieve?
I’m reading a true/false value from InfluxDB. It’s not boolean, but a string. I’d like to color-code this in state timeline, but it seems not to be recognized.
As you can see here, a false condition is present from around 29th of May on. When pointing the mouse at it, it turns into a lighter green, and the legend points out true and false, both in green.
-
How are you trying to achieve it?
I tried to use several options in value mapping, but none seems to be applied:
-
What happened?
True and False keep both shown as green. -
What did you expect to happen?
I expect “false” condition to be shown in different colour. -
Can you copy/paste the configuration(s) that you are having problems with?
{
"id": 10,
"type": "state-timeline",
"title": "Dachs 1",
"gridPos": {
"x": 15,
"y": 7,
"h": 3,
"w": 3
},
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 0,
"fillOpacity": 70,
"spanNulls": false,
"insertNulls": false,
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"axisPlacement": "auto"
},
"color": {
"mode": "thresholds"
},
"mappings": [
{
"type": "value",
"options": {
"\"false\"": {
"index": 0,
"text": "test",
"color": "red"
},
"false": {
"index": 1,
"text": "test",
"color": "red"
}
}
},
{
"type": "special",
"options": {
"match": "false",
"result": {
"color": "red",
"text": "test",
"index": 2
}
}
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"pluginVersion": "12.0.1",
"targets": [
{
"alias": "Dachs1",
"datasource": {
"type": "influxdb",
"uid": "cfe3660c-5657-4b9f-8e3a-1334241171bb"
},
"groupBy": [],
"measurement": "parser.0.BHKWs.Dachs1_laeuft",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT \"value\" FROM \"parser.0.BHKWs.Dachs1_laeuft\" WHERE time > now() - 1h",
"rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
}
]
],
"tags": []
}
],
"datasource": {
"type": "influxdb",
"uid": "cfe3660c-5657-4b9f-8e3a-1334241171bb"
},
"options": {
"mergeValues": true,
"showValue": "auto",
"alignValue": "left",
"rowHeight": 0.9,
"legend": {
"showLegend": true,
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none",
"hideZeros": false
}
}
}
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
Not aware of, no. -
Did you follow any online instructions? If so, what is the URL?
I checked the other results on Grafana Community for “value mapping not working”, but without success.
Thanks for any hint!