Just finished writing this and thought some one may find it handy so im letting the world have it :)
in order to use just do something like this:
<?php
$chartdata['data'] = array("col1" =>2, "col2" =>40, "col3"=> 10, "col4" =>5);
$chartdata['colours'] = array("0, 0, 255"...