A(nother) Scatter chart with an offset X axis
This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.scatter.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="600" height="200">
[No canvas support]
</canvas>
This is the code that generates the chart:
<script>
new RGraph.Scatter({
id: 'cvs',
data: [
[412,-150], [155,-261], [351,41], [455,-291], [121,-55], [89,-111],
[400,-66], [358,45], [500,-288], [321,-168], [111,45], [436,88]
],
options: {
xmax: 500,
labels: ['0-100','101-200','201-300','301-400','401-500'],
ymin: -300,
ymax: 100,
numyticks: 4,
ylabelsCount: 4,
gutterLeft: 50,
backgroundGridVlines: false,
backgroundGridAutofitNumhlines: 4,
backgroundGridColor: '#eee',
backgroundGridBorder: false,
unitsPost: ' %',
textColor: '#888',
axisColor: '#999',
tickmarks: 'circle'
}
}).draw();
</script>
« Back