Skip to content

Stacked bar charts #35

Answered by dbuezas
oischinger asked this question in Q&A
Apr 5, 2022 · 4 comments · 3 replies
Discussion options

You must be logged in to vote

Try this instead then:

type: custom:plotly-graph
entities:
  - entity: sensor.teich_plug_wattage
  - entity: sensor.beamer_plug_wattage
  - entity: sensor.office_plug_wattage
  - entity: sensor.backofen_plug_wattage
hours_to_show: 6
refresh_interval: 1
title: Power Consumption (24h)
color_scheme: 2
layout:
  barmode: stack
defaults:
  entity:
    stackgroup: one
    line:
      shape: spline
    lambda: |-
      (ys, xs) => {
        const MINUTES = 15; // <-- change here
        const window_size_ms = 1000*60*MINUTES ;
        const result = {x:[], y:[]};
        const t0 = Math.ceil(+xs[0]/window_size_ms)*window_size_ms;
        const t1 = Math.ceil(+xs[xs.length-1]/window_size_ms)*wind…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@oischinger
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@oischinger
Comment options

@lloyda
Comment options

Answer selected by dbuezas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants