A Bar chart in a ModalDialog

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.tooltips.js"></script>
<script src="RGraph.modaldialog.js"></script>
<script src="RGraph.bar.js"></script>
This is the code that generates the chart:
<script>
        window.onload = function ()
        {
            ModalDialog.Show('string:<div style="text-align: center; padding: 15px"><canvas id="cvs" width="750" height="250">[No canvas support]</canvas><br /><a href="javascript:ModalDialog.close()">[Close dialog]</a></div>');

            var bar = new RGraph.Bar({
                id: 'cvs',
                data: [12,18,10,9,6,20,18],
                options: {
                    tooltips: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
                    labels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
                    unitsPost: 'k',
                    shadow: false,
                    colors: ['red'],
                    strokestyle: 'rgba(0,0,0,0)',
                    textSize: 14,
                    title: 'A Bar chart inside a ModalDialog',
                    numyticks: 5,
                    noxaxis: true,
                    scaleZerostart: true
                }
            }).draw();
            
            RGraph.tooltips.style.zIndex = 99999;
        }
</script>

« Back