A stacked, spline Line chart
This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.key.js"></script>
<script src="RGraph.line.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>
new RGraph.Line({
id: 'cvs',
data: [
[4,6,12,16,8,4,2,8,18,16,14,16],
[2,4,8,4,2,6,6,12,8,10,6,8],
[1,3.5,5,3,4,5,6,11,8,9,5,7]
],
options: {
xaxisLabels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
marginLeft: 40,
marginTop: 35,
marginRight: 15,
marginBottom: 35,
colors: ['black', 'black', 'black'],
filled: true,
filledAccumulative: true,
filledColors: ['Gradient(white:red)', 'Gradient(white:blue)', 'Gradient(white:green)'],
yaxisScaleUnitsPost: '%',
linewidth: 0.25,
spline: true,
title: 'Robert, Daniel and Janices statistics',
titleVpos: 0.5,
textColor: '#333',
textFont: 'Arial',
key: ['Robert', 'Daniel', 'Janice'],
keyColors: ['red', 'blue', 'green'],
keyBackground: 'white',
keyPositionX: 50,
shadowOffsety: 2,
shadowBlur: 5,
tickmarksStyle: null,
backgroundGridVlinesCount: 11,
xaxisTickmarksCount: 11
}
}).on('beforedraw', function (obj)
{
RGraph.clear(obj.canvas, 'white');
}).draw().trace2({frames: 60});
</script>