Series disappear when stacking bars

  • What Grafana version and what operating system are you using?
    Linux version 5.15.93-rockchip64 (armbian)
    Grafana v9.2.4

  • What are you trying to achieve?
    Display Influx time series as stacked bars

  • How are you trying to achieve it?
    Using the time series panel with this query:

fields = ["chaudiere", "cumulus", "VMC", "garage", "piscine"]

from(bucket: "iota-autogen")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "energy")
  |> filter(fn: (r) => contains(value: r._field, set: fields))
  |> drop(columns: ["device"])
  |> fill(value: 0.0)
  |> aggregateWindow(every: ${kWh_interval}, fn: sum )
  • What happened?

When selecting Style: “Bars” and Stack series: “Normal” in the panel options, one of the series (cumulus) disappears. Its points are there, its tooltip works, but there is no visible bar.
When using Stack series: Off or 100% the display is as expected

  • What did you expect to happen?
    I expected to get all series displayed a color-filled bars, stacked.

  • Can you copy/paste the configuration(s) that you are having problems with?

{
  "datasource": {
    "uid": "TNIAL2DVz",
    "type": "influxdb"
  },
  "fieldConfig": {
    "defaults": {
      "custom": {
        "drawStyle": "bars",
        "lineInterpolation": "stepBefore",
        "barAlignment": 0,
        "lineWidth": 2,
        "fillOpacity": 100,
        "gradientMode": "none",
        "spanNulls": false,
        "showPoints": "auto",
        "pointSize": 5,
        "stacking": {
          "mode": "normal",
          "group": "A"
        },
        "axisPlacement": "auto",
        "axisLabel": "",
        "axisColorMode": "text",
        "scaleDistribution": {
          "type": "linear"
        },
        "axisCenteredZero": false,
        "hideFrom": {
          "tooltip": false,
          "viz": false,
          "legend": false
        },
        "thresholdsStyle": {
          "mode": "off"
        }
      },
      "color": {
        "mode": "palette-classic"
      },
      "mappings": [],
      "thresholds": {
        "mode": "absolute",
        "steps": [
          {
            "color": "green",
            "value": null
          },
          {
            "color": "red",
            "value": 80
          }
        ]
      },
      "links": [],
      "min": 0,
      "unit": "kwatth"
    },
    "overrides": [
      {
        "matcher": {
          "id": "byName",
          "options": "VMC"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "orange",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "chaudiere"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "rgb(138, 67, 68)",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "garage"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "rgb(143, 143, 143)",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "piscine"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "semi-dark-blue",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "cumulus energy"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "transparent",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "cumulus"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "dark-red",
              "mode": "fixed"
            }
          }
        ]
      }
    ]
  },
  "gridPos": {
    "h": 7,
    "w": 11,
    "x": 11,
    "y": 14
  },
  "id": 9,
  "interval": "30m",
  "options": {
    "tooltip": {
      "mode": "single",
      "sort": "none"
    },
    "legend": {
      "showLegend": true,
      "displayMode": "list",
      "placement": "bottom",
      "calcs": []
    }
  },
  "pluginVersion": "9.2.3",
  "targets": [
    {
      "datasource": {
        "type": "influxdb",
        "uid": "TNIAL2DVz"
      },
      "alias": "$col",
      "groupBy": [
        {
          "params": [
            "$__interval"
          ],
          "type": "time"
        },
        {
          "params": [
            "null"
          ],
          "type": "fill"
        }
      ],
      "orderByTime": "ASC",
      "policy": "default",
      "query": "fields = [\"chaudiere\", \"cumulus\", \"VMC\", \"garage\", \"piscine\"]\n\nfrom(bucket: \"iota-autogen\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"energy\")\n  |> filter(fn: (r) => contains(value: r._field, set: fields))\n  |> drop(columns: [\"device\"])\n  |> fill(value: 0.0)\n  |> aggregateWindow(every: ${kWh_interval}, fn: sum )\n",
      "rawQuery": true,
      "refId": "A",
      "resultFormat": "time_series",
      "select": [
        [
          {
            "params": [
              "value"
            ],
            "type": "field"
          },
          {
            "params": [],
            "type": "mean"
          }
        ]
      ],
      "tags": []
    }
  ],
  "title": "Infrastructure",
  "transformations": [],
  "type": "timeseries"
}
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us No errors in the logs

  • Did you follow any online instructions? If so, what is the URL?
    No

Thanks,
Franck

Any idea about this problem? I can’t make the time series panel to work in “bar” mode, no matter what stacking mode I choose something is wrong:

  • stack none → one bar hides the other
  • stack normal → lately all series disappear, not just one

Still no errors in the logs, is that panel working for anyone??

Here is what I mean when saying that tooltips work:

… and if I select a single series then it displays as expected: