An example of a Bar chart with bars-in-bars

By using two bar chart objects you can achieve a bar-in-bar effect. Here it shows the total amount of cars produced versus those sold. It's similar to a stacked or grouped Bar chart.

There's an SVG version of this chart here.

[No canvas support]

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>
    data = {};
    data.shipped = [88000,88000,105000,105000,116000,116000,126000];
    data.sold    = [30000,54000,54000,62000,63000,68000,68000];

    bar1 = new RGraph.Bar({
        id: 'cvs',
        data: data.shipped,
        options: {
            marginTop: 40,
            marginLeft: 70,
            colors: ['rgba(0,0,255,0.2)'],
            xaxisLabels: ['Fred','Barney','Wilma','Betty','Dino','Bam-bam','Pebble'],
            labelsAbove: data.shipped,
            title: 'Total cars produced vs sold',
            titleSize: 14,
            colorsStroke: 'rgba(0,0,0,0)',
            xaxisScaleZerostart: true,
            shadow: true
        }
    }).draw();

    bar2 = new RGraph.Bar({
        id: 'cvs',
        data: data.sold,
        options: {
            yaxisScaleMax: bar1.scale2.max,
            marginTop: 40,
            marginLeft: bar1.Get('marginLeft'),
            colors: ['pink'],
            axes: false,
            labelsAbove: true,
            hmargin: 20,
            yaxisLabels: false,
            backgroundGrid: false,
            colorsStroke: 'rgba(0,0,0,0)',
            shadow: true
        }
    }).draw();
</script>