Skip to content

Setting bar width and alignment #184

Answered by dbuezas
elbertov asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, that was hard:

Problems

  • The home assistant API assigns a timestamp to the first datapoint which is not the start of the day, but the start of the period queried. This means there are usually two bars very close together, and plotly is forced to make thin bars
  • you had a "show_value" in the defaults, which makes no sense for bar charts, and adds more bars at the end of the chart, which also confuses plotly.

Solution

type: custom:plotly-graph
entities:
  - entity: sensor.energy_heating_oil
    statistic: state
    period: day
    type: bar
    opacity: 0.5
    texttemplate: '%{y:0.1f}'
    filters:
      - delta
      - filter: i>0 # the first value has the timestamp of the beginning …

Replies: 6 comments 18 replies

Comment options

You must be logged in to vote
0 replies
Comment options

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

Comment options

You must be logged in to vote
7 replies
@dbuezas
Comment options

@miljbee
Comment options

@dbuezas
Comment options

@miljbee
Comment options

@thecem
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@dbuezas
Comment options

@thecem
Comment options

@dbuezas
Comment options

@miljbee
Comment options

@dbuezas
Comment options

Answer selected by dbuezas
Comment options

You must be logged in to vote
5 replies
@thecem
Comment options

@miljbee
Comment options

@dbuezas
Comment options

@miljbee
Comment options

@miljbee
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #182 on January 09, 2023 19:45.