This bar chart uses the ModalDialog which in turn uses the onmodaldialog event which is added using DOM1 style methods. Click on the canvas and a ModalDialog will be shown that uses the DOM1 style onmodaldialog event to show an alert().
This goes in the documents header:<script src="RGraph.common.core.js"></script> <script src="RGraph.common.dynamic.js"></script> <script src="RGraph.modaldialog.js"></script> <script src="RGraph.bar.js"></script>Put this where you want the chart to show up:
<canvas id="cvs" width="600" height="250"> [No canvas support] </canvas>This is the code that generates the chart:
<script> bar = new RGraph.Bar({ id: 'cvs', data: [4,8,5,3,4,6,8], options: { xaxisLabels: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'], shadowOffsetx: 2, shadowOffsety: 2, shadowBlur: 2, backgroundGridVlinesCount: 7, textSize:16 } }).draw().on('click', function (e, shape) { ModalDialog.Show('string:A sample dialog
Close '); }).on('mousemove', function (e, shape) { return true; }).on('onmodaldialog', function (obj) { console.log('In the onmodaldialog DOM1 style event listener'); }); </script>