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: {
labels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
unitsPost: '%',
shadow: false,
colors: ['red'],
strokestyle: 'rgba(0,0,0,0)',
textSize: 10,
title: 'A Bar chart with an offset X axis',
numyticks: 11,
gutterLeft: 50,
scaleZerostart: true,
ymin: -10,
ymax: 100,
backgroundGridVlines: false,
backgroundGridAutofitNumhlines: 11,
backgroundGridBorder: false,
ylabelsCount: 11
}
}).draw();
</script>
« Back