How to set the graph_span of ApexCharts in the UI?

Many (financial) charts have the option to control the timeframe shown, like this one for example.

I want to do the same using ApexCharts, so I’ve made the chart shown in the picture at the bottom of my question.

The buttons above the chart all change a Text helper called input_text.timeframe to the value in their title (1h, 12h, 24h,…). These values are all accepted by the option graph_span as correct time strings.

I retrieve the string in the Text helper with this code:
{{ states (’ input_text. timeframe’) }}
Putting that code in developer tools returns the correct string: the text of the button last pressed.

However, that code does not work when inserted in ApexCharts, as shown below:

I can’t seem to find a solution for this problem.

(I’ve also tried every suggestion in this thread)

Does somebody have a solution for this? Many thanks in advanse.

  1. There is a DEDICATED thread for apexcharts card. Better to ask questions there.
  2. I do not think templates are supported for this option. Have you seen anything about supporting templates in Docs? If not - then probably not supported.