Mini-graph-card: Feature request: combine different units in one graph [like % & 潞]

Created on 8 Aug 2019  路  6Comments  路  Source: kalkih/mini-graph-card

I was polishing my graphs when some idea popped up.
what if I'd like to draw a graph with temperature and humidity in one room? or maybe a graph with % cpu used and it's temperature?

tried to overcome it with additional sensors, templates, calculating ratios etc. to make the graphs readable in a "normal" way but with no luck. and to be honest: I don't like overpopulating the sensors just to make some additional infos.

would it be possible to add some setting for multiple entities graph that i would show let's say - percentage "in the background" and temperature "as the front graph"? the 100% mark would be taken from the highest temperature readout, so the percentage graph would look nice whatever temperature it is; and vice-versa: the temperature would be readable no matter if the % is high or low.

I hope I explained it correctly - English isn't my first language & sometimes it's hard for me to tell something that sounds totally easy.. ;)

feature request

Most helpful comment

I saw that secondary graph line overlaps the main one

This is a good point (I contributed the secondary axis code). You can control the overlap by sequencing the entities as @kalkih says - if you list the secondary first, subsequent ones will be on top. However, this would make the secondary the number read-out, which is not what you'd want. I will have a look at making all of the secondary graphs plot 'behind' the primary ones.

I also like the idea of the left number read-out being for the primary (left) axis, and the right number read-out being for the secondary (right) axis, but this would possibly be a breaking change. I'm currently looking at the feasibility of the number read-out and min/max changing as you hover, so will have a think about this at the same time. However, it may end up too complicated and as @kalkih has said elsewhere, it may impact performance too much.

All 6 comments

Hey,
Yeah I totally understand what you mean, similar to how the default history graph does it when you mix sensors with different measurements.

Even though it would have been cool to add, it does complicate things a fair bit, so I'm not sure if we'll ever add this, but it's possible.

However, what you already can do right now is having two seperate y-axes that acts independently from each other, so you could have a graph with both temp & humidity for example, and they would both fill the entire y-axis as long as you set one of them to the secondary y-axis.
It's kinda complicated to describe but check this example.

It does require a few more lines of config (specify axis) but it should basically do what you want, at least when you got less than three measurements (for now)

hi! thanks for adding the feature request tag!

I tried configuring secondary y-axis before. it kinda works similar to what I want to achieve, but there are some small disadvantages I think.

that multigraph option still shows only one number-readout at once (or I can't make it right?). meaning I can configure temperature as main and humidity as secondary, but secondary value shows only on tapping/hovering over the graph - and while normally it's ok for let's say - average temp read or similar, with temp/humidity combo it would be nice to have for example: temp on left, humidity on right side of the header.

also, I saw that secondary graph line overlaps the main one - while it would be cool to have an option to send that to the background, as a secondary (important, but less ;) readout).

greatest thing would be the ability to merge linear style graph with boxed one, but I think I'm asking for too much :D

basically, after I read what I wrote, I guess that making detailed config options for each of the graphs/values in the multigraph case would be the goal, but I can see where it's kinda difficult to implement that without breaking existing configuration, so every currently used graph won't be messed up after update :/

that multigraph option still shows only one number-readout at once (or I can't make it right?). meaning I can configure temperature as main and humidity as secondary, but secondary value shows only on tapping/hovering over the graph - and while normally it's ok for let's say - average temp read or similar, with temp/humidity combo it would be nice to have for example: temp on left, humidity on right side of the header.

You can actually do this already in the entity object with help of the show_state option.

greatest thing would be the ability to merge linear style graph with boxed one, but I think I'm asking for too much :D

Yeah, that sounds tricky 馃槅 but you should be able to change the rendering order by changing the order in which you list the entities in the config.

basically, after I read what I wrote, I guess that making detailed config options for each of the graphs/values in the multigraph case would be the goal,

What config options are you missing, or do you mean the documentation?

I saw that secondary graph line overlaps the main one

This is a good point (I contributed the secondary axis code). You can control the overlap by sequencing the entities as @kalkih says - if you list the secondary first, subsequent ones will be on top. However, this would make the secondary the number read-out, which is not what you'd want. I will have a look at making all of the secondary graphs plot 'behind' the primary ones.

I also like the idea of the left number read-out being for the primary (left) axis, and the right number read-out being for the secondary (right) axis, but this would possibly be a breaking change. I'm currently looking at the feasibility of the number read-out and min/max changing as you hover, so will have a think about this at the same time. However, it may end up too complicated and as @kalkih has said elsewhere, it may impact performance too much.

hi! forgive me my delay, meet some bumps after upgrading hassio [still have them] so couldn't concentrate on answering earlier.

@kalkih
regarding the show_state option. it won't show two states, or I'm wrong?

regarding "missing options" - I got the impression, that not all configuration settings are available to all charts in the multichart option. maybe I'm wrong then - will try to play with all if only I'll bring my HA back from the dead.

@michaelblight
yeah, sequencing works, but then messes up with state display like you've already noticed :(

regarding the show_state option. it won't show two states, or I'm wrong?

regarding "missing options" - I got the impression, that not all configuration settings are available to all charts in the multichart option. maybe I'm wrong then - will try to play with all if only I'll bring my HA back from the dead.

It should, double check your config and make sure you've on the latest version of the card.

Please also double check the resource reference to the card and make sure it matches the one specified in HACS (if installed through HACS).

All options here are entity specific and can be specified on all entities individually (except for show_state: false, which is not a valid option for the first entity in the config).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clydefrog76 picture clydefrog76  路  6Comments

skarfacegc picture skarfacegc  路  7Comments

isabellaalstrom picture isabellaalstrom  路  6Comments

tomlut picture tomlut  路  4Comments

balloob picture balloob  路  4Comments