Button that displays variable

Hi everyone,

I’ve no doubt this has been answered before but searches so far have proved fruitless. I’m probably using the wrong search terms.

What widget should I be using if I want to display the temperature from a sensor, but upon clicking that widget, it will display a graph of the temperature over the past 24 hours (or whatever else I want it to display).