A bar chart with above and below bars

Share RGraph:   

ID: 268

[No canvas support]

This goes in the documents HEAD:
<script src="/libraries/RGraph.common.core.js"></script>
<script src="/libraries/RGraph.bar.js"></script>

This goes in the documents ONLOAD event (or equivalent):
var data1 = [[2,5,9],[4,2,6],[6,5,8]];
var data2 = [[-2,-1,-6],[0,0,-6],[0,-5,-8]];


var bar1 = new RGraph.Bar('cvs', data1)
    .set('shadow', false)
    .set('strokestyle', 'rgba(0,0,0,0)')
    .set('noaxes', true)
    .set('ylabels', false)
    .set('colors', ['blue'])
    .set('hmargin', 25)
    .set('background.grid.autofit.numvlines', 3)
    .set('colors', ['Gradient(black:#aaa:black)'])
    .set('xaxispos', 'center')
    .set('ymax', 10)
    .draw();

var bar2 = new RGraph.Bar('cvs', data2)
    .set('shadow', false)
    .set('colors', ['Gradient(red:#faa:red)'])
    .set('hmargin', 25)
    .set('xaxispos', 'center')
    .set('background.grid', false)
    .set('ymax', 10)
    .draw();

This goes in the documents BODY:
<canvas id="cvs" width="600" height="250">[No canvas support]</canvas>