I noticed the graph goes outside the viewport so I found different magic values that work. Not sure if it would work for everyone, but playing at 150% scale it works well for me.
The new values make the X axis start and end just after the ends of the viewport and the Y axis has a bit of space on the top and bottom.
I did change a few extra lines to make changing the magic values easier in the future (if needed).
Here is a diff of the changes I made:
https://gist.github.com/Clinery1/be92244fa394871271c609dfc5279cb7