I've actually tweaked it a little with some progress but now i am getting a totally different error. I've also changed some of the variable and array names and added a second part to the function and some math.
Here is the actual code outside of the queries:
PHP Code:
//array data (this is true)
//sizes
$cirsz[1] = 'small';
$cirsz[2] = 'medium';
$cirsz[3] = 'large';
//colors
$circlr[1] = 23;
$circlr[2] = 20;
$circlr[3] = 18;
//function
function Settings($cirsz, $circlr) {
global $cirsz;
global $circlr;
// This callback will adjust the fill color and size of
// the datapoint according to the data value according to
$z = 0;
//get size
foreach($cirsz as $s){
$z++;
if($s == 'small'){
$sz = 15;
}elseif($s == 'medium'){
$sz = 30;
}else{
$sz = 50;
}
}
//get colors
foreach ($circlr as $c){
$z++;
if($c <= 25 && ($c >= 18.75)){
$col = "red";
}elseif($c < 18.75 && ($c >= 12.5)){
$col ="orange";
}elseif($c < 12.5 && ($c >= 6.25)){
$col = "yellow";
}else{
$col = "green";
}
}
return array($sz, "", $col);
}
If I echo $col and $sz I get the proper values however it's returning this error:
Warning: Missing argument 2 for Settings()
It's also looping three times over, once for each datapoint in the array.
Bookmarks