Skip to content

Limit y axis to one graph #262

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

You must be logged in to vote
type: custom:plotly-graph
hours_to_show: current_week
entities:
  - entity: sensor.senseair_temperature
  - entity: sensor.durchgang_thermometer_temperature
    
layout:
  uirevision: $fn () => Math.random() // force rescale on scroll
  yaxis:
    range: |
        $fn ({ getFromConfig }) => {
          const all = getFromConfig("entities.1").y;
          return [
            Math.max(12, Math.min(...all)), // cap to lowest value, but at least 12
            Math.min(18, Math.max(...all)), // cap to highest value, but at most 18
          ]
        }

Replies: 3 comments 1 reply

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
0 replies
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
2 participants