Currently the ChiSquare module assumes that the data you're testing is meant to be evenly distributed. I've wanted to make that configurable for a long time, so if anyone can come up with a nice way of doing it, I would be delighted to apply your patch.
I also need to hack on it to support more degrees of freedom.
Comment on Re^2: Stats: Testing whether data is normally (Gaussian) distributed