A basic SVG Bar chart

This goes in the documents header:
<script src="RGraph.svg.common.core.js"></script>
<script src="RGraph.svg.common.tooltips.js"></script>
<script src="RGraph.svg.bar.js"></script>
Put this where you want the chart to show up:
<div style="padding: 15px">
    <div style="width: 750px; height: 300px" id="chart-container"></div>
</div>
This is the code that generates the chart:
<script>
    bar = new RGraph.SVG.Bar({
        id: 'chart-container',
        data: [8,5,9,3,5,2,4],
        options: {
            gutterTop: 50,
            hmargin: 20,
            xaxisLabels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
            tooltips: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],                
            title: 'A basic Bar chart',
            titleSubtitle: 'A chart showing the daily totals for last week',
            titleSubtitleItalic: true,                
            colors: ['red','pink'],
            shadow: true,
            shadowOpacity: 0.2
        }
    }).draw();
</script>

« Back