Skip to content

How to add a reference line? #357

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

You must be logged in to vote

Like the "Now line" https://github.com/dbuezas/lovelace-plotly-graph-card?tab=readme-ov-file#now-line but horizontal in the other axis.

Option 1

The line spreads as wide as is currently visible:

  - entity: ""
    name: Theshold of 15
    yaxis: y
    showlegend: false
    line:
      width: 1
      dash: dot
      color: deepskyblue
    x: "$ex get('visible_range')"
    y: [15,15]

Option 2

The line spreads as wide as another entity

  - entity: sensor.the_other_entity
    filters:
      - store_var: other_entity
  - entity: ""
    name: Theshold
    yaxis: y
    showlegend: false
    line:
      width: 1
      dash: dot
      color: deepskyblue
    x: 
      - "$ex vars.other_entity.xs.at(0)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dbuezas
Comment options

You must be logged in to vote
0 replies
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