Commit 240cf92c authored by Hamza Arfaoui's avatar Hamza Arfaoui

CAFI176

parent 5a253552
......@@ -2584,7 +2584,39 @@ function graph_data($vars, $data, $colors)
{
$settings['label_colour'] = $vars['label_colour'];
}
if($vars['graph_mode'] == 'rdv_percent' || $vars['graph_mode'] == 'presta_percent' || $vars['graph_mode'] == 'nfc_percent'){
$settings['grid_division_v'] = 10;
}
if($vars['graph_mode'] == 'dma' || $vars['graph_mode'] == 'dme' || $vars['graph_mode'] == 'dma-dme'){
$max_time = 0;
foreach ($data as $row) {
if($vars['graph_mode'] == 'dma'){
if(intval($row["dma"]) > $max_time){
$max_time = intval($row["dma"]);
}
}
if($vars['graph_mode'] == 'dme'){
if(intval($row["dme"]) > $max_time){
$max_time = intval($row["dme"]);
}
}
if($vars['graph_mode'] == 'dma-dme'){
if(intval($row["dma-dme"]) > $max_time){
$max_time = intval($row["dma-dme"]);
}
}
}
if($max_time > 1000 && $max_time <8000){
$graph_modes[5]['spacing'] = 1000;
$graph_modes[6]['spacing'] = 1000;
$graph_modes[7]['spacing'] = 1000;
}
if($max_time > 8000){
$graph_modes[5]['spacing'] = 3600;
$graph_modes[6]['spacing'] = 3600;
$graph_modes[7]['spacing'] = 3600;
}
}
foreach ($graph_modes as $graph_mode)
{
if (!empty($vars['graph_mode']) && $graph_mode['id'] == $vars['graph_mode'] || empty($vars['graph_mode']) && $graph_mode['id'] == 'count')
......@@ -2943,7 +2975,7 @@ function hms($laps)
{
$laps = sprintf("%.0f",$laps);
if ($laps >= 3600)
return sprintf("%d:%02d:%02d", $laps / 3600, ($laps / 60) % 60, $laps % 60);
return sprintf("%d:%02d:%02d", (int)($laps / 3600), (int)($laps / 60) % 60, $laps % 60);
else
return sprintf("%2d:%02d", $laps / 60, $laps % 60);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment