Apexcharts span offset depending on time of day

I try to make the span offset in apexcharts +{{now().hour}}h.
I tried to copy examples I found on the forum, using offset_template or not.
I’m lost, Anyone have an idea what I do wrong?
The graph is used for day ahead prices. By not showing prices for hours in the past the graph get more easily readable.

Below is a simplified apexcharts card configuration where I don’t manage to make the offset equal to now().hour

type: custom:apexcharts-card
span:
  start: day
  offset: +17h
yaxis:
  - id: first
series:
  - entity: sensor.electricityprice_by_hour_2
    type: column
    data_generator: |
      return entity.attributes.hourly.map((record, index) => {
        return [record.date, 100 * record.price];
      })

To answer my own question: just fill in “hour” instead of “day” at span.
Sometimes things are so simple once you know them.

1 Like