Limit y axis to one graph #262
Answered
by
dbuezas
seidler2547
asked this question in
Q&A
Replies: 3 comments 1 reply
-
You could store the datapoints in vars using a filter and then set the layout:yaxis:range with a $ex. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hmm, I was looking at this: #233 |
Beta Was this translation helpful? Give feedback.
1 reply
-
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
]
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dbuezas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to have the y axis scale according to only one of the three values I'm plotting. Background is that I plot max_allowed, actual and min_allowed, but most of the time actual is far away from both values. Hence I would like to scale the y axis to only consider the actual graph , with the max and min coming into view when actual is getting close to them. I tried to play around with yaxes functions but haven't found a way to do it.
Beta Was this translation helpful? Give feedback.
All reactions