This goes in the documents header:
<script src="RGraph.common.core.js"></script> <script src="RGraph.drawing.background.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>
var background = new RGraph.Drawing.Background({
id: 'cvs',
options: {
gutterLeft: 55,
gutterRight: 35,
gutterTop: 35,
gutterBottom: 35,
backgroundGridAutofitNumvlines:48,
backgroundGridAutofitNumhlines: 20,
backgroundGridColor: '#eee',
textAccessible: true
}
}).draw();
var line = new RGraph.Line({
id: 'cvs',
data: [5,4,15,-5,8,5,3],
options: {
labels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
gutterLeft: 55,
gutterRight: 35,
gutterBottom: 35,
gutterTop: 35,
title: 'A line chart showing the outofboundsClip option',
backgroundGridColor: '#aaa',
backgroundGridDashed: true,
outofbounds: true,
outofboundsClip: true,
ymax: 10,
noxaxis: true,
textAccessible: true
}
}).draw();
</script>