I have spent days trying to figure this out, but now I have hit a dead end. I simply can’t figure out what I am doing wrong here.
I want to show for a year, all 12 months on the axis starting from jan-dec and I want to get long term statistics for doing this. I can show the graphs but the visuals look crazy.
Here is the code
type: custom:config-template-card
entities:
- sensor.offset_template
- input_number.month_offset
- sensor.energy_graph_sensor_name
card:
type: custom:apexcharts-card
graph_span: ${ '1year' }
update_interval: 1d
header:
show: false
show_states: true
colorize_states: false
standard_format: true
series:
- entity: ${states['sensor.energy_graph_sensor_name'].state}
color: lightblue
type: column
name: Yearly Usage
statistics:
type: change
period: month
align: start
span:
start: year
offset: >-
${'-' + parseInt(states['input_number.month_offset'].state) +
'year'}
apex_config:
chart:
fontFamily: Amazon Ember Bold, sans-serif
foreColor: "#444444"
xaxis:
labels:
format: MMM
Look at these two pictures, one for 2024 and one for 2025. My statistics started in november 2024 when the device went online. The x axis scales are all corrupt, wite space, and the bars are in the wrong year, which looks like it not calculating the ranges for the months okay. I have checked the data using sql sensor, and when I do a group by here, the data in the LTS looks fine. Obviously I am doing something wrong, but I can’t find it anywhere in my code. Please help!!