How do you make a button that has been pressed and turn it into data and chart?

Use TinyDB to hold your variables in separate tags between runs.