//top3色块值
$topcolor = array();
$topColorU = array("f70a0a","ec3535","f15555");
$topColorD = array("10f610","4cdf4c","74f274");
$top3Value = array($top3_1_val,$top3_2_val,$top3_3_val);
//$top3Value2 = rsort($top3Value);
//var_dump($top3Value);die();
rsort($top3Value);
if ($top3Value[0] > 0) {
$top3_01_value = "+" . $top3Value[0] . "%";
} elseif($top3Value[0] <0) {
$top3_01_value = "" . $top3Value[0] . "%";
}else{
$top3_01_value = "--";
}
if ($top3Value[1] > 0) {
$top3_02_value = "+" . $top3Value[1] . "%";
} elseif($top3Value[1] <0) {
$top3_02_value = "" . $top3Value[1] . "%";
}else{
$top3_02_value = "--";
}
if ($top3Value[2] > 0) {
$top3_03_value = "+" . $top3Value[2] . "%";
} elseif($top3Value[2] <0) {
$top3_03_value = "" . $top3Value[2] . "%";
}else{
$top3_03_value = "--";
}
//var_dump($top3Value);die();
if(($top3_1_val == 0 and $top3_2_val == 0) and $top3_3_val ==0){
for($i=0;$i<3;$i++){
$topcolor[] = $topColorU[$i];
}
}else{
$i = 0;
//var_dump($top3Value);
foreach($top3Value as $key => $value){
if($value>0){
$topcolor[] = $topColorU[$i];
//array_splice($top3Value,1,1);
unset($top3Value[$i]);
}
$i = $i + 1;
}
array_merge($top3Value);
$top3Value = array_merge($top3Value);
$i = 0;
foreach($top3Value as $key => $value){
if($value<0){
$topcolor[] = $topColorD[$i];
}
$i = $i + 1;
}
}