Work = (force) x (distance)
With a force/distance graph, the work is the area under the graph.
If the graph is curved, broken, or some other screwy shape that makes it difficult to
get the area in any simple way, then work is the integral of the function represented
by the graph.