Bookmark and share:
Bookmark with delicious tweet this site Post to Google Buzz! Post to Facebook Share on FriendFeed Stumble! this site

RGraph: HTML5 canvas graph library - Retrieving a PNG of your graph

[No canvas support]

RGraph provides an easy way to get a PNG image of your graph, by way of a context menu item. This allows you to easily save the image locally to use in (for example) a document, spreadsheet or presentation.

Since the function is designed to be used in conjunction with a context menu, it is part of the RGraph.common.context.js file.


Include the context menu code:

<script src="../libraries/RGraph.common.context.js" ></script>

Add the context menu:

myGraph.Set('chart.contextmenu', [
                                  ['Get PNG', RGraph.showPNG],
                                  null,
                                  ['Cancel', function () {}]
                                 ]);