Fit range and chiSquare

See the answer at

Fit range and chiSquare