A 2D Bar chart with an offset X axis
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; display: inline-block">
<canvas id="cvs" width="750" height="250">[No canvas support]</canvas>
</div>
This is the code that generates the chart:
<script>
new RGraph.Bar({
id: 'cvs',
data: [14,16,68,-9,-6,40,36],
options: {
backgroundGridVlines: false,
backgroundGridHlinesCount: 11,
backgroundGridBorder: false,
xaxisLabels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
yaxisScaleUnitsPost: '%',
yaxisScaleMin: -10,
yaxisScaleMax: 100,
yaxisLabelsCount: 11,
yaxisTickmarksCount: 11,
marginLeft: 50,
shadow: false,
colors: ['red'],
colorsStroke: 'rgba(0,0,0,0)',
textSize: 10,
title: 'A Bar chart with an offset X axis',
titleSize: 14
}
}).draw();
</script>