-
What Grafana version and what operating system are you using?
Grafana v11.1.4 (2355de00c6) on Linux -
What are you trying to achieve?
I want a pie chart to represent a boolean custom fieldmyPrefix.isMySuffix
from an elasticsearch data source. I want the segments to be labelled true/false (or yes/no or 1/0). -
How are you trying to achieve it?
- In the query, I am using the
Metrics
tab and have selectedMetric: Count
andGroup By: Terms: myPrefix.isMySuffix
. - In [the options pane > Value options], I specified
Show: All values
andFields: Count
.
-
What happened?
I get a pie chart where both segments are labelled ‘Count’. -
What did you expect to happen?
I expected that the labels would correspond to the values true/false (which are the values in my data for the fieldmyPrefix.isMySuffix
. -
Can you copy/paste the configuration(s) that you are having problems with?
{
"datasource": {
"type": "elasticsearch",
"uid": "REDACTED"
},
"fieldConfig": {
"defaults": {
"custom": {
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
}
},
"color": {
"mode": "palette-classic"
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 6,
"x": 6,
"y": 1
},
"id": 2,
"options": {
"reduceOptions": {
"values": true,
"calcs": [
"count"
],
"fields": "/^Count$/"
},
"pieType": "pie",
"tooltip": {
"mode": "single",
"sort": "none"
},
"legend": {
"showLegend": true,
"displayMode": "list",
"placement": "bottom",
"values": [
"percent"
]
},
"displayLabels": [
"name",
"value"
]
},
"pluginVersion": "11.1.4",
"targets": [
{
"alias": "",
"bucketAggs": [
{
"field": "myPrefix.isMySuffix",
"id": "2",
"settings": {
"min_doc_count": "0",
"order": "desc",
"orderBy": "_term",
"size": "2"
},
"type": "terms"
}
],
"datasource": {
"type": "elasticsearch",
"uid": "REDACTED"
},
"hide": false,
"metrics": [
{
"hide": false,
"id": "1",
"type": "count"
}
],
"query": "",
"refId": "B",
"timeField": "@timestamp"
}
],
"title": "REDACTED",
"type": "piechart"
}
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No errors -
Did you follow any online instructions? If so, what is the URL?
No particular online instructions