Is there another good way to do two separate graphs on top of each other? I don’t want to use HA grids, because if I scroll to the left or right, I want both graphs to change there x-axis simultanously.
Looks good! This card is not the easiest one, but it is really flexible by design.
I’m considering adding presets, including an option to share them via gist url
Why is it neccesary to use yaxis: y1 or yaxis: y2 for each entity? For me it works also, if I don’t use it.
And if I use yaxis: y1 and yaxis: y2, without a title for yaxis: and yaxis2:, the default °C for the upper graph is missing. Why is that?
Can I disable the legend only of the humidity in a way, that if I disable a the temperature graph by clicking it, it will also hide the coresponding humidity-graph? The problem I have right now is, that I have two times the label of ATC1 and ATC2, because one is the temperature, and one the humidity. And it is not necessary. See screenshot below.
How can I make the color of ATC1_temperature the same as ATC1_humidity? This would be necessary for the way i mentioned it under “3.”.
How can I get a lineplot with marks? I am trying this now for a long time, and can’t get a nice solution. The only solution I’ve got is, to plot the graph twice. One time with line: and one time with mode: markers.
It leads to my wanted result, but I have the feeling, that the performance now is lacking in my graph with 8 entities (so 16 graphs, if I add the marks every time as extra graph).
I just wanted to add an example of a solution I have for a problem: when you show a graph which takes data from the long term statistics, the last value is not always up-to-date (sometimes it takes a while before it is updated). To work around this, I used this: map_y_numbers: '(i<ys.length-1) ? y : hass.states["sensor.daily_gas"].state'
Full code:
type: custom:plotly-graph
title: Gas daily
entities:
- entity: sensor.daily_gas
statistic: state
period: day
type: bar
texttemplate: '%{y}'
filters:
- filter: i>0
- map_y_numbers: '(i<ys.length-1) ? y : hass.states["sensor.daily_gas"].state'
marker:
color: '148E99'
time_offset: 12h
hours_to_show: 240
defaults:
yaxes:
fixedrange: true
layout:
height: 250
Great card, i use it mainly for temperature sensors and such, however i added the Garmin integration together with a couple of sensors that i’m trying to make graphs for.
For example, how would i make a graph for the steps counter? What i’m looking to get out is total steps each day in a nice bar graph.
This is what i got so far but it´s acting kind of funny with panning and zooming.
IMO this is too complex for the forum and I’ll forget. I suggest you make a Q&A post in the Discussions section of the github repository instead, somebody else may also join the analysis
Another option is to set the layout:xaxis:range with an expression, but then it will snap back if you scroll. I think the code above should have all you need
Ahh yes, cool, your first reply is great! but I decided for second option layout:xaxis:range which works great and is much easier when I have ‘fixedrange: true’ for yaxes and xaxis.
range: $ex [new Date().setHours(5,0,0,0), new Date().setHours(21,0,0,0)]
I might be little lost here.
A few days ago I decided to migrate from apex chart, because they caused extreme front- (and) backend lags.
I am happy so far, but there is one or two things I am really struggling with.
1, How do you make the current entity value to show inside of the legend and not on the end of the line as on some dual data graphs this is not viable.
2, Is there a way so that the yaxis does move if the data escape its limits and adapts to the data.
What I was trying to achieve is that I want to have the range from 15 °C to 25 °C, but if the temperature goes below 15 °C or above 25 °C it will autoadjust the range to the maximal value.
For example the temperature will be 15.03 °C, then I want the range to auto adjust to: from 15.03 °C to 25 °C.
If it the temperature is for example 26.54 °C, then I want the range to auto adjust to: from 17 °C to 26.54 °C.
So you want it to be 10 degrees from min to max, where min is the smallest between observed and 15 and the max is the biggest between observed and 25, right?
I think you need this: