Statistic Graph Card - Hide legend

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:
stat-graph

I would like something like:
stat-graph-new

Is it possibile? I didn’t find any “hide” option in Statistics Graph Card - Home Assistant

Thank you

3 Likes

It is possible but you have to use card mod:

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.