--- a/displayBubbletree.php +++ b/displayBubbletree.php @@ -19,11 +19,17 @@ $(function() { hsl2hex(Array($cats/10, .7, .5)); $catName = $unspsc[$row['cat'] . "0000000"] . $row['cat']; if ($row['cat'] == "") $catName = "null"; $subnodes = Array(); @@ -48,26 +56,27 @@ FROM `contractnotice` WHERE childCN = 0 and LEFT( categoryUNSPSC, 2 ) = '{$tworow['cat']}' GROUP BY cat ;"); + $subCatColor = $color->hsl2hex(Array($cats/10, rand(1,10)/10, .5)); while ($threerow = mysql_fetch_assoc($catthreesresult)) { $subsubcatName = $unspsc[$threerow['cat'] . "00000"] . $threerow['cat']; if ($threerow['cat'] == "") $subsubcatName = "null"; $subsubnodes[] = Array( "label" => $subsubcatName, "amount" => $threerow['value'], - "color" => "#000000" + "color" => "#".$subCatColor ); } $subnodes[] = Array( "label" => $subcatName, "amount" => $tworow['value'], - "color" => "#000000", + "color" => "#".$subCatColor, "children" => $subsubnodes ); } $nodes[] = Array( "label" => $catName, "amount" => $row['value'], - "color" => "#000000", + "color" => "#".$catColor, "children" => $subnodes ); $total+= $row['value'];