filling the rectangle based on the stats