Ejemplo n.º 1
0
 protected function chartjs_line_three_inited_with_timedist($one, $two, $three)
 {
     $secord_x = Variables::timedist();
     $res = Variables::chartjs_line_three($one, $two, $three);
     foreach ($secord_x as $key => $time) {
         $hour = (int) ($time / 3600);
         $minute = (int) ($time % 3600 / 60);
         $secord = (int) ($time % 60);
         if ($hour == 0) {
             $hour = '';
         } else {
             $hour = (string) $hour . 'H';
         }
         if ($minute == 0) {
             $minute = '';
         } else {
             $minute = (string) $minute . 'M';
         }
         if ($secord == 0) {
             $secord = '';
         } else {
             $secord = (string) $secord . 'S';
         }
         $time = $hour . $minute . $secord;
         $res['labels'][$key] = $time;
         $res['datasets'][0]['data'][$key] = 0;
         $res['datasets'][1]['data'][$key] = 0;
         $res['datasets'][2]['data'][$key] = 0;
     }
     $res['labels'][count($secord_x)] = 'MORE';
     $res['datasets'][0]['data'][count($secord_x)] = 0;
     $res['datasets'][1]['data'][count($secord_x)] = 0;
     $res['datasets'][2]['data'][count($secord_x)] = 0;
     return $res;
 }