Instead of using a key that's drawn onto the canvas this shows you an example of using the HTML based key that was added to RGraph in December 2013. To use it effectively it will help if you first understand CSS positioning - both relative and absolute.
<script src="RGraph.common.core.js"></script> <script src="RGraph.common.key.js"></script> <script src="RGraph.bar.js"></script>Put this where you want the chart to show up:
<div id="container" style="position: relative"> <canvas id="cvs" width="600" height="250">[No canvas support]</canvas> </div>This is the code that generates the chart: