#14; Correction graphique des durées d'appel (tri des données)
This commit is contained in:
parent
6cc97d862d
commit
67ede5f52a
|
@ -691,14 +691,30 @@
|
|||
/* [4] On formatte les données
|
||||
=========================================================*/
|
||||
$formattedData = array();
|
||||
$sortedData = array();
|
||||
|
||||
|
||||
// 1. Mise au bon format
|
||||
foreach($times as $duration=>$count){
|
||||
array_push($formattedData, array(
|
||||
$duration, $count
|
||||
));
|
||||
}
|
||||
|
||||
// 2. tri des données
|
||||
while( count($formattedData) > 0 ){
|
||||
|
||||
$min = null;
|
||||
|
||||
foreach($formattedData as $d=>$data)
|
||||
if( $min == null || $data[0] < $formattedData[$min][0] )
|
||||
$min = $d;
|
||||
|
||||
if( $min == null )
|
||||
break;
|
||||
|
||||
array_push($sortedData, $formattedData[$min]);
|
||||
unset($formattedData[$min]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -713,7 +729,7 @@
|
|||
'series' => array(
|
||||
array( // En fonction des appels
|
||||
'name' => 'communications',
|
||||
'data' => $formattedData
|
||||
'data' => $sortedData
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue