This will get you close. Your graph will be a bit smaller because of the window's title bar, which I believe is part of the window's size. Your dotsPerInch value might also be changed if you've set the scaling on your display. Retina displays and 4K displays will probably use larger DPI values.
DotsPerInch = 96; // typical for newer displays, 72 for older displays
report(gb)<<setwindowsize(6.8*DotsPerInch,8*DotsPerInch);
or...
The frame is the square box that the axes form.
Once you drag the window to the size you need, you can save the script and grab the size value from the script.
Setting graph builder's size
That will not account for changing font sizes later however, since it is the frame size.
Craige