A Bar chart showing income/expenditure
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>
data1 = [[2,5,9],[4,2,6],[6,5,8]];
data2 = [[-2,-1,-6],[0,0,-6],[0,-5,-8]];
new RGraph.Bar({
id: 'cvs',
data: data1,
options: {
marginLeft: 35,
shadow: false,
colorsStroke: 'rgba(0,0,0,0)',
axes: false,
yaxisLabels: false,
colors: ['Gradient(black:#aaa:black)', 'Gradient(black:#aaa:black)', 'Gradient(black:#aaa:black)'],
hmargin: 25,
backgroundGridVlinesCount: 3,
xaxisPosition: 'center',
textSize: 14,
yaxisScaleMax: 10
}
}).wave();
new RGraph.Bar({
id: 'cvs',
data: data2,
options: {
marginLeft: 35,
shadow: false,
colors: ['Gradient(red:#faa:red)', 'Gradient(red:#faa:red)', 'Gradient(red:#faa:red)'],
hmargin: 25,
xaxisPosition: 'center',
textSize: 14,
backgroundGrid: false,
yaxisScaleMax: 10
}
}).wave();
</script>