It's possible to do things pretty much like that with zero (or almost zero) code, using (say) Kst.
All you need to do is log your serial data (if your serial console software supports that). Kst will act on file changes and plot in real-time.
I've tried doing it in Python in the past too, and it's possible to send the configuration over serial too. I chose to send out JSON from the microcontroller (not really a serial streaming protocol! there will be better options), and then the Python code self-creates charts according to what's coming over the JSON-over-serial (say, writing the following over the UART: {“temperature”: 21.7, “sound”: 45} {“sound”: 47} {“sound”: 44} {“temperature”: 21.5, “sound”:43} and so on).
Screenshot example below in case it gives you ideas.
Sometimes it's easier to do something custom for the task-at-hand, for instance using WebSerial and JavaScript as you have done, although just a personal preference, I don't do anything except simple displaying of values etc with JavaScript, I'd rather do any data work with Python or Matlab etc.