Bar Chart (With Negatives)


Pre-requisites

<script src="/SCG/mootools.js" type="text/javascript"></script>
<script src="/SCG/mootools-more.js" type="text/javascript"></script>
<script src="/SCG/raphael.js" type="text/javascript"></script>
<script src="/SCG/src/format.js" type="text/javascript"></script>
<script src="/SCG/src/chart.js" type="text/javascript"></script>
<script src="/SCG/src/barchart.js" type="text/javascript"></script>

Bar charts can also have negative values, these are identical to normal Bar charts but with negative values within their data array. Negative Bar chards are therefore a form of SCGBarchart and are based around two arrays, a data array and a labels array.

The data array defines the numerical values for the chart, the labels array defines the corresponding
labels for those values.

For example:

window.addEvent( 'domready', function(){
	new SCGBarchart( 'test1', {
		yaxis: 'thingies',
		data: [ 
			10, -20, 30, -14, 19, 47, 139, 
			233, 123, 55, -2, 73, 18, 45, 
			22, 100, 28, 156 
		],
		labels: [ 
			'label1', 'label2', 'label3', 
			'label4', 'label5', 'label6', 
			'label7', 'label8', 'label9', 
			'label10', 'label11', 'label12', 
			'label13', 'label14', 'label15', 
			'label16', 'label17', 'label18' 
		]
	});
});