marcurs
(Marco)
August 17, 2022, 2:20pm
1
Hi everyone,
is it possibile to hide the legend or showing only the entity name (and not the min, avg, max) one time?
Now is:
I would like something like:
Is it possibile? I didn’t find any “hide” option in Statistics Graph Card - Home Assistant
Thank you
3 Likes
tom_l
August 18, 2022, 6:51am
2
It is possible but you have to use card mod:
I found a way to hide the legends using this module:
and adding the following to the yaml for the statistics graph config:
style:
.: |
h1 {
padding-bottom: 0;
}
statistics-chart$ha-chart-base$: |
.chartLegend {
display: none;
}
A simple option would be a lot easier, but this is working for me in the meantime.
card-mod thread → 1st post → link at the bottom → styles for statistics graph card
It would be great to have an easy toggle in the UI
1 Like
You may create FR for this.
Not sure when it was added, but you can now go into the YAML config and disable the legends simply by adding hide_legend: true
. See Statistics graph card - Home Assistant
Example
title: Memory Usage
chart_type: line
period: 5minute
type: statistics-graph
entities:
- sensor.memory_use_percent
stat_types:
- max
days_to_show: 2
hide_legend: true
1 Like
This option was added some time ago.
It allows to hide the whole legend.
To hide a part of legend - we need to use card-mod.
For instance, we have 3 entities on the card and this:
card_mod:
style:
.content statistics-chart $:
ha-chart-base $: |
.chartLegend li:nth-child(n+7) {
display: none;
}
hides a legend for the 3rd entity.