WTH aren't the history and statistics graph card more alike

The history and statistics graph card have a lot in common. Most obviously that the output is both a graph. However there are some nice graphing related options available in the history card that are missing from the statistics card and vice versa. I would expect the graphing output options to be the same/similar even though the input data for the graph is different.

For example these 2 graphs for some temperature sensors.

Note that the history card has a title which is a link to the history dashboard for when you want to dig in a bit more which is very useful.

The history card also allows to set ranges for the Y-axis which is very nice. The history card shows a (imho) nicer temperature graph. The one from the statistics card looks like the temperature varies wildly while it is only a few degrees.

The other way around the history card is missing the option to hide the legend which I use regularly on the statistics card.

For reference the settings screens

Min/Max Y was added to statistics graph card for 2024.12 release.

History card legend can also be disabled with show_names: false in yaml. I guess that’s not a UI option though.

Ah, cool. Looking forward to the 2024.12 release for the Y axis options.

I am a bit suprised that there are yaml only settings for a card that is otherwise configurable in the UI. If there is a UI I would assume that all are shown there. I did not even think about looking at the documentation for more hidden configuration options.

This is pretty typical. The goal of the UI is not to overwhelm users with 100 options, so more advanced or niche options often start out in yaml only, and sometimes stay there. Always check the card docs for the full options.

1 Like

This makes me wonder :thinking: Why are there two separate cards doing very similar things? Can we combine the two?

Internally - they may be based on same code (may be).
For a user:
– set of options is different for “history-graph” & “statistics-graph”;
– only sensors with particular state_class are permitted for “statistics-graph”.
And what happens if a user has a selector “history/statistics” on UI and starts playing with it after setting up other options & selecting entities…

That would be pretty neat if there was one graph card, and for each entity that is selected, you could choose the source of the data to graph. Ideally the list would be filtered to only what is available for that entity, but I think the full list would be:

  • State (from states table)
  • 5-minute Min (from short_term_statistics table, for measurement state class)
  • 5-minute Avg (from short_term_statistics table, for measurement state class)
  • 5-minute Max (from short_term_statistics table, for measurement state class)
  • 5-minute Sum (from short_term_statistics table, for total or total_increasing state class)
  • 5-minute State (from short_term_statistics table, for total or total_increasing state class)
  • Hourly Min (from statistics table, for measurement state class)
  • Hourly Avg (from statistics table, for measurement state class)
  • Hourly Max (from statistics table, for measurement state class)
  • Hourly Sum (from statistics table, for total or total_increasing state class)
  • Hourly State (from statistics table, for total or total_increasing state class)

And if the source is anything except the states table, you could choose “column” instead of line graph for that entity. Which would allow for plotting lines and columns on the same graph.