Daily cost in statistics graph

I am trying to get a statistics graph with the total cost (energy + gas) in a dashboard.
I have managed to get the calculated total cost like this:

  - platform: template
    sensors:
      energy_gas_en_elektriciteit_dagelijks_eur:
        friendly_name: 'Totale netto dag kosten energie'
        value_template: "{{ (states('sensor.energy_gas_daily_eur')|float + states('sensor.energy_import_total_dagelijks_eur')|float)|round(2) }}"
        unit_of_measurement: "€"

This works for a normal entity card but I cannot select this sensor when using the statistics graph card.

How can I get daily cost into a statistics graph card?