Save as for graph (rebased onto develop)



This is the same as gh-2665 but rebased onto develop.

----

Option to save the graph as JPEG or PNG
To test the PR
 * View an image. Open the Measurement tool
 * Draw a line. Save and select
 * Go the Graph pane.
 * A line plot should be displayed. Export the graph as JPEG or PNG. Only the line plot should be exported.
 * Repeat the previous steps but this time with a rectangle.