# A grouped bar chart

This is a grouped Bar chart.

hmargin.grouped setting:

This goes in the documents header:

    <script src="RGraph.common.core.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>
        window.onload = function ()
        {
            // A global on purpose
            bar = new RGraph.Bar({
                id: 'cvs',
                data: [[1250,1450,750,450],[1300,1375,750,525],[1500,1480,650,600],[1450,1500,700,450]],
                options: {
                    labels: ['Jan 2008\r\nStart year','Jan 2009\r\nBest year','Jan 2010\r\nLast year','Jan 2011\r\nThis year!'],
                    colors: ['#C7CFC7','#B2C8B2','#D9E0DE','#CDDED1'],
                    hmargin: 15,
                    hmarginGrouped: 3,
                    gutterLeft: 45,
                    gutterBottom: 45,
                    backgroundGridVlines: false,
                    backgroundGridBorder: false,
                    textSize: 12,
                    strokestyle: 'rgba(0,0,0,0)',
                    shadow: false,
                    textAccessible: true
                }
            }).draw();
        };
    </script>

« Back