A stacked range Bar chart

This is achieved by using a stacked Bar chart and setting the first color to be transparent.

[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:
<div style="padding: 15px">
    <canvas id="cvs" width="750" height="250">[No canvas support]</canvas>
This is the code that generates the chart:
    new RGraph.Bar({
        id: 'cvs',
        data: [[3,4,8],[5,2,2],[4,3,5],[6,3,5],[8,4,8],[1,1,5],[4,6,5]],
        options: {
            labels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
            unitsPost: 'k',
            grouping: 'stacked',
            shadow: false,
            colors: ['transparent', 'red','green'],
            colorsReverse: true,
            strokestyle: 'rgba(0,0,0,0)',
            textSize: 14,
            textAccessible: true,
            title: 'A stacked range Bar chart',
            numyticks: 5,
            gutterLeft: 50,
            scaleZerostart: true,
            key: ['Dave','Luis'],
            keyPosition: 'gutter',
            keyColors: ['red','green'],
            hmargin: 15

Share on Facebook Share on Twitter

« Back