Problem
In Home Assistant, the apexcharts-card currently does not allow dynamic values for:
- yaxis.min
- yaxis.max
- apex_config.yaxis.tickAmount
When using templates such as:
max: "{{ states('sensor.max_cena_elektriny_dnes') | float }}"
…the card throws:
Bad yaxis min/max format
Even when the template sensor exists and returns a valid number.
When using native ApexCharts functions such as:
max: |
function (max) { return Math.ceil(max); }
…the function is ignored.
The card also rejects stepSize as “extraneous”, even though ApexCharts supports it.
Why this matters
For sensors with variable ranges (e.g., electricity spot prices), the Y-axis becomes unreadable:
Instead of clean values like:
Without dynamic min/max or tickAmount, charts cannot adapt to real-world data.
Feature request
Please allow one of the following:
- Support for templates in yaxis.min, yaxis.max, and tickAmount
- Support for ApexCharts native functions in these fields
- Support for stepSize
- Or any mechanism to allow dynamic scaling of the Y-axis
This would greatly improve readability and usability of charts in Home Assistant.
Thanks for considering this improvement!
Additional context
Here is a screenshot showing the issue with the Y‑axis scaling:
Here is the English version of the chart configuration used for the screenshot:
type: custom:apexcharts-card
header:
show: true
title: Electricity Prices – Final vs. Buyback
graph_span: 24h
span:
start: hour
now:
show: true
label: Now
yaxis:
- id: prices
decimals: 2
min: ~0
series:
- entity: sensor.finalni_cena_elektriny
name: Final Price
type: line
stroke_width: 2
color: "#ff9800"
yaxis_id: prices
- entity: sensor.vykupni_cena_elektriny
name: Buyback Price
type: line
stroke_width: 2
color: "#4caf50"
yaxis_id: prices
Problem
In Home Assistant, the apexcharts-card currently does not allow dynamic values for:
When using templates such as:
max: "{{ states('sensor.max_cena_elektriny_dnes') | float }}"
…the card throws:
Bad yaxis min/max format
Even when the template sensor exists and returns a valid number.
When using native ApexCharts functions such as:
max: |
function (max) { return Math.ceil(max); }
…the function is ignored.
The card also rejects stepSize as “extraneous”, even though ApexCharts supports it.
Why this matters
For sensors with variable ranges (e.g., electricity spot prices), the Y-axis becomes unreadable:
Instead of clean values like:
Without dynamic min/max or tickAmount, charts cannot adapt to real-world data.
Feature request
Please allow one of the following:
This would greatly improve readability and usability of charts in Home Assistant.
Thanks for considering this improvement!
Additional context
Here is a screenshot showing the issue with the Y‑axis scaling:
Here is the English version of the chart configuration used for the screenshot: