Skip to content

feat: column chart of totals per hour, day, week or month - #98

Merged
tempus2016 merged 1 commit into
mainfrom
feat/column-chart
Nov 2, 2026
Merged

tempus2016 merged 1 commit into
mainfrom
feat/column-chart

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

A new history style, column: vertical columns over time, for energy used per day, rain per hour or hours of heating per day. It uses the shared history frame, so periods, previous/next, statistics, axes, the tooltip and the compact layout all work as on the line chart.

It is set up to be right with no options. With no period it shows the last 7 days; with no group_by it picks a grouping for the span (hours up to two days, days up to two months, then weeks, then months; today by hour, a week or month by day, a year by month); and with no aggregate it shows how much a meter went up (change) when every entity is a meter (state_class total or total_increasing), else the average. So an energy meter on its own draws a column of kWh per day. group_by: none draws one column per reading.

  • Rounded outer ends (rounded, on by default). Columns are drawn as HTML over the plot rather than in its stretched SVG, so corners stay round.
  • labels puts each column's value on top (a stack's total), and hides them when the columns are too narrow to fit them.
  • stack: normal piles series up; stack: percent scales each column to 100 %. Positive values stack up from zero, negative ones down.
  • Negative values hang below zero, and the axis always includes zero.
  • color_by: bands colours each column by its value's colour band.
  • range: true draws each column from the group's lowest to its highest, with the average marked across it. From statistics it asks the recorder for min and max; from history it takes the spread of the values held in each group. The shared history frame gained an opt-in for this, so other charts are unchanged.
  • Several entities sit side by side in each group.
  • An entity's target (from the Limits section) is marked across each of its columns.
  • When grouped, the time axis puts one label under each set of columns (Mon, Tue... or 26 Oct, Oct, Nov), every second or third when they would not fit, and the tooltip names the whole group ("26 Oct - 1 Nov") and highlights it.

Editor: Chart section has the period (7 days by default), Group readings by (with Automatic and Don't group), Combine with, Stack, Colour, Range, Show values on the columns and Rounded tops, then axes and layout. Each entity gets its own Colour.

Part of milestone 1.3.0 (tracker #47). Tested on the dev Home Assistant instance.

Closes #11

A new history style, `column`: vertical columns over time, for energy used
per day, rain per hour or hours of heating per day. It uses the shared
history frame, so periods, previous/next, statistics, axes, the tooltip and
the compact layout all work as on the line chart.

It is set up to be right with no options. With no period it shows the last
7 days; with no `group_by` it picks a grouping for the span (hours up to two
days, days up to two months, then weeks, then months; today by hour, a week
or month by day, a year by month); and with no `aggregate` it shows how much
a meter went up (`change`) when every entity is a meter (`state_class` total
or total_increasing), else the average. So an energy meter on its own draws
a column of kWh per day. `group_by: none` draws one column per reading.

- Rounded outer ends (`rounded`, on by default). Columns are drawn as HTML
  over the plot rather than in its stretched SVG, so corners stay round.
- `labels` puts each column's value on top (a stack's total), and hides them
  when the columns are too narrow to fit them.
- `stack: normal` piles series up; `stack: percent` scales each column to
  100 %. Positive values stack up from zero, negative ones down.
- Negative values hang below zero, and the axis always includes zero.
- `color_by: bands` colours each column by its value's colour band.
- `range: true` draws each column from the group's lowest to its highest,
  with the average marked across it. From statistics it asks the recorder
  for min and max; from history it takes the spread of the values held in
  each group. The shared history frame gained an opt-in for this, so other
  charts are unchanged.
- Several entities sit side by side in each group.
- An entity's `target` (from the Limits section) is marked across each of
  its columns.
- When grouped, the time axis puts one label under each set of columns
  (Mon, Tue... or 26 Oct, Oct, Nov), every second or third when they would
  not fit, and the tooltip names the whole group ("26 Oct - 1 Nov") and
  highlights it.

Editor: Chart section has the period (7 days by default), Group readings by
(with Automatic and Don't group), Combine with, Stack, Colour, Range, Show
values on the columns and Rounded tops, then axes and layout. Each entity
gets its own Colour.

Closes #11
@github-actions github-actions Bot added the tests The unit suite and coverage label Nov 2, 2026
@tempus2016
tempus2016 merged commit 3e158af into main Nov 2, 2026
9 checks passed
@tempus2016
tempus2016 deleted the feat/column-chart branch November 2, 2026 21:59
@github-project-automation github-project-automation Bot moved this from Todo to Done in Chartdeck Planner Nov 2, 2026
github-actions Bot pushed a commit that referenced this pull request Nov 2, 2026
## [1.3.0](v1.2.0...v1.3.0) (2026-11-02)

### Features

* area chart of an entity's history, filled, stacked or split at zero ([#97](#97)) ([4fdefb5](4fdefb5)), closes [#10](#10)
* column chart of totals per hour, day, week or month ([#98](#98)) ([3e158af](3e158af)), closes [#11](#11)
* combined chart mixing lines, columns and areas, with a second axis ([#99](#99)) ([d79ffc2](d79ffc2)), closes [#12](#12)
* group a chart's readings by hour, day, week or month ([#94](#94)) ([5ec00e5](5ec00e5)), closes [#49](#49)
* show today, this week, an earlier period, and step back with buttons ([#93](#93)) ([53d4b21](53d4b21)), closes [#50](#50)

### Bug Fixes

* space time labels by the plot's width, not the card's ([#96](#96)) ([4897ccf](4897ccf))

### Documentation

* Chartdeck is in the HACS default store ([#100](#100)) ([d139a27](d139a27))
* list the area, column and combined charts in the README ([#101](#101)) ([3d7823e](3d7823e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests The unit suite and coverage

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Chart]: Column chart

1 participant