added functionality for exporting graph as png