Not about to get a Line graph, only a history view

not sure if I am doing something silly, but I am trying to so some data within a entity which I have convert from KM to Miles, but when I go and look at the history of the sensor I am getting the history bar, and not a nice line chart, but if I use the default sensor for KM, then I get the nice line graph.

the code I am using to convert is

  • platform: template
    sensors:
    car_range:
    value_template: >
    {{ (states(‘sensor.range’) | float / 1.609) | round(2) }} m

which is place within my sensor.yaml file.

hope this is a easy fix.

I believe it should be:

template:
  - sensor:
      - name: "Car Range"
        unit_of_measurement: "Miles"
        state: >
          {{ (states('sensor.range') | float(0) / 1.609) | round(2, default=0) }}