Stacking Values


please see my picture. The last yellow bar is hiding a green bar which has the same value.
I want to display both stacked, where yellow goes from 0-8 and green from 8-16 and in the tooltips both have the 8. What do i need to set?

Toggling stack to true should work.

Can you maybe share the the panel JSON and data using the Query inspector?

image
If I stack them via this button then I get in the hoover menu a value of the top element that is the sum of both. There seems to be no option to chance that. Also picture looks a bit buggy.

Can you please share the the panel JSON and data using the Query inspector? Otherwise it is hard to say what is wrong.

1 Like

yes sure

{

“aliasColors”: {},

“bars”: true,

“dashLength”: 10,

“description”: “Wärmemenge Heizungsanlage für Wasser und Heizung”,

“fieldConfig”: {

"defaults": {

  "custom": {},

  "links": [],

  "mappings": [],

  "thresholds": {

    "mode": "absolute",

    "steps": [

      {

        "color": "green",

        "value": null

      },

      {

        "color": "red",

        "value": 80

      }

    ]

  }

},

"overrides": []

},

“fill”: 1,

“gridPos”: {

"h": 8,

"w": 12,

"x": 0,

"y": 16

},

“id”: 23763571993,

“legend”: {

"alignAsTable": false,

"avg": false,

"current": false,

"hideEmpty": false,

"hideZero": false,

"max": false,

"min": false,

"rightSide": false,

"show": true,

"total": false,

"values": false

},

“linewidth”: 1,

“nullPointMode”: “connected”,

“pluginVersion”: “7.1.5”,

“pointradius”: 2,

“renderer”: “flot”,

“seriesOverrides”: [

{

  "$$hashKey": "object:82",

  "alias": "",

  "yaxis": 1

}

],

“spaceLength”: 10,

“stack”: true,

“targets”: [

{

  "alias": "Wärmemenge Heizung",

  "groupBy": [

    {

      "params": [

        "$__interval"

      ],

      "type": "time"

    },

    {

      "params": [

        "previous"

      ],

      "type": "fill"

    }

  ],

  "hide": false,

  "measurement": "smartmeter.0.1-0:1_8_0__255.value",

  "orderByTime": "ASC",

  "policy": "default",

  "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM(\nSELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"hpcontrol.0.values.151\" WHERE $timeFilter GROUP BY time(1d)\n) WHERE $timeFilter GROUP BY time(1d) ",

  "rawQuery": true,

  "refId": "C",

  "resultFormat": "time_series",

  "select": [

    [

      {

        "params": [

          "value"

        ],

        "type": "field"

      },

      {

        "params": [],

        "type": "mean"

      }

    ]

  ],

  "tags": []

},

{

  "alias": "Wärmemenge Wasser",

  "groupBy": [

    {

      "params": [

        "$__interval"

      ],

      "type": "time"

    },

    {

      "params": [

        "previous"

      ],

      "type": "fill"

    }

  ],

  "hide": false,

  "measurement": "smartmeter.0.1-0:1_8_0__255.value",

  "orderByTime": "ASC",

  "policy": "default",

  "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM(\nSELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"hpcontrol.0.values.152\" WHERE $timeFilter GROUP BY time(1d)\n) WHERE $timeFilter GROUP BY time(1d) ",

  "rawQuery": true,

  "refId": "B",

  "resultFormat": "time_series",

  "select": [

    [

      {

        "params": [

          "value"

        ],

        "type": "field"

      },

      {

        "params": [],

        "type": "mean"

      }

    ]

  ],

  "tags": []

}

],

“thresholds”: [],

“timeRegions”: [],

“title”: “Wärmemenge Heizungsanlage”,

“tooltip”: {

"shared": true,

"sort": 0,

"value_type": "cumulative"

},

“transparent”: true,

“type”: “graph”,

“xaxis”: {

"buckets": null,

"mode": "time",

"name": null,

"show": true,

"values": []

},

“yaxes”: [

{

  "$$hashKey": "object:89",

  "decimals": 1,

  "format": "kwatth",

  "label": "",

  "logBase": 1,

  "max": null,

  "min": "0",

  "show": true

},

{

  "$$hashKey": "object:90",

  "decimals": 2,

  "format": "watth",

  "label": "Wh",

  "logBase": 1,

  "max": null,

  "min": null,

  "show": false

}

],

“yaxis”: {

"align": false,

"alignLevel": null

},

“dashes”: false,

“fillGradient”: 0,

“hiddenSeries”: false,

“interval”: “”,

“lines”: false,

“percentage”: false,

“points”: false,

“steppedLine”: false,

“timeFrom”: null,

“timeShift”: null,

“datasource”: null

}

Could you please also share the data.

It has no “green” data on 10/23 day. It should be add 0 value to this day, or join a time series tables, which include days value on every days.

(This’s a limited “feature” in Grafana…)

here is the data

2020-10-14 02:00:00,29,4.399999999999636
2020-10-15 02:00:00,21.399999999999977,10.899999999999636
2020-10-16 02:00:00,28,4.400000000001455
2020-10-17 02:00:00,48.89999999999998,9.399999999999636
2020-10-18 02:00:00,31.100000000000023,4.899999999999636
2020-10-19 02:00:00,34,7.899999999999636
2020-10-20 02:00:00,30.69999999999999,7.600000000000364
2020-10-21 02:00:00,26,7.5
2020-10-22 02:00:00,8.300000000000011,2.600000000000364
2020-10-24 02:00:00,14.199999999999989,8.600000000000364
2020-10-25 02:00:00,26.900000000000034,5.699999999998909
2020-10-26 01:00:00,36.5,5.399999999999636
2020-10-27 01:00:00,26.09999999999991,6.200000000000728
2020-10-28 01:00:00,26.299999999999955,2.7999999999992724
2020-10-29 01:00:00,28.399999999999977,2.400000000001455
2020-10-30 01:00:00,16.5,9.5
2020-10-12 02:00:00,74
2020-10-23 02:00:00,8

Based on provided data on 2020-10-23 your response has just 1 value which is 8, which is then correctly displayed in the graph panel. If you’ve had 2020-10-23 02:00:00,8,8 , it would show you the values on top of each other.

Here is also a similar issue and explanation https://github.com/grafana/grafana/issues/12535

Dont think its correct behavior, It is taking not the 8, its taking the 8.3 from the day before and lifts it in the air.

image

and do you know how to use 0 for undefined values?

I don’t know what data source are you using.