For many springs, the force to stretch the spring is proportional to the distance the spring is stretched (Hooke's Law). This means that the graph of force vs. position, in this case, will be a straight line passing through the origin (F = 0 when stretch = 0). The area under the force vs. position graph will be a triangle, which makes the work done to stretch the spring easy to calculate.
Suppose that it takes a force of 40 Newtons to hold a spring when it is stretched 1 meter from its normal rest position. How much work was done in stretching the spring this distance?
See the animation at right. (Compare this to the "average force" calculation.)