Skip to content

Add stacked chart types to Statistics Graph Card#51530

Open
TCWORLD wants to merge 4 commits intohome-assistant:devfrom
TCWORLD:stacked-statistics-chart
Open

Add stacked chart types to Statistics Graph Card#51530
TCWORLD wants to merge 4 commits intohome-assistant:devfrom
TCWORLD:stacked-statistics-chart

Conversation

@TCWORLD
Copy link
Copy Markdown
Contributor

@TCWORLD TCWORLD commented Apr 12, 2026

Proposed change

Allows displaying the entries as stacked lines or stacked bars.

This allows creating statistics charts similar to the energy graph cards but with non-energy entities.

One current limitation is the stacked line chart will not currently show the "now" state because we have no unit conversion so cannot easily guarantee that all entries will be sensible values when stacking them. Easier to just omit that point entirely.

Screenshots

Visual editor supported, simply adds extra options to "Chart type":

image

Stacked Lines:

image

Stacked Bars:

image

For comparison, the existing Bar and Line options:

image image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to backend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

TCWORLD added 2 commits April 12, 2026 18:44
Allows displaying the entries as stacked lines or stacked bars. This means we can create charts similar to the energy graph cards but with alternate entities.
Now used in statistics-chart too, so move to common chart location.
Re-export in energy-chart-options.ts to minimise changes throughout energy cards.
Line and Bar options were unintentionally reversed in the displayed list.
@TCWORLD TCWORLD marked this pull request as ready for review April 12, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant