This plugin needs a massive refactoring on each part of it.
Here it is the todo list:
Use vite instead of webpack for the script
Convert the script to typescript
Move to PSR-4
Use new events hook for plugin class
And an optional but nice to have: drop Chart and jpgraph for a modern library to draw graphs.