è QUI che fa la echo di $valore e che non funziona:
Mettiamola in queste parole: come si inserisce una number_format che mi formatti il valore di $valore in questo codice:Codice PHP:switch($id){ case 1: echo "<polygon title =\"".$regione."\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"".$color."\" stroke=\"#A7DBEE\" stroke-width=\"1.4173\" stroke-miterlimit=\"10\" points=\" 61.327,60.879 65.627,58.012 71.003,52.635 72.437,50.484 71.003,42.957 71.72,40.448 79.962,36.863 83.905,35.789 88.563,30.77 \"/>";
echo "<text id=\"piemonte\" x=\"40\" y=\"130\" >".$valore."%</text>";
break;
Codice PHP:function getPolygon($id, $valore, $tipo, $regione){ if($tipo == "occ"){ if($valore<10) {$color="#FF3300";} elseif($valore>=10&&$valore<50) {$color="#FF9900";} else{$color="#66CC00";} } elseif($tipo == "dis") { if ($valore<10){$color="#66CC00";} elseif ($valore>=10&&$valore<50){$color="#FF9900";} else { $color="#FF0000";} } switch($id){ case 1: echo "<polygon title =\"".$regione."\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"".$color."\" stroke=\"#A7DBEE\" stroke-width=\"1.4173\" stroke-miterlimit=\"10\" points=\" 61.327,60.879 65.627,58.012 71.003,52.635 72.437,50.484 71.003,42.957 71.72,40.448 79.962,36.863 83.905,35.789 88.563,30.77 \"/>"; echo "<text id=\"piemonte\" x=\"40\" y=\"130\" >".$valore."%</text>"; break;

Rispondi quotando