Create a sensor for gas consumption

Does the template sensor have a state? If yes, I don’t see why it shouldn’t work.
Check if you see an error here
Open your Home Assistant instance and show your statistics developer tools.
Maybe you need to wait again.

I don’t think it is possible with Energy dashboard, but you can certainly make custom long-term statistic graphs with something like apexcharts-card.