Пример #1
0
 public function ZeroChart()
 {
     $total = Planet::count();
     $planets = Arrays::planetTypeArray();
     for ($i = 0; $i < count($planets); $i++) {
         $totalType = Planet::where('planet', $i)->count();
         $result[$planets[$i]] = $totalType / $total * 100;
     }
     return $result;
 }
Пример #2
0
 function changeLocale($locale)
 {
     $pairs = Arrays::translate($locale);
     $this->name = $this->thirdChartName($locale, $this->nameStyle);
     $array = [];
     foreach ($this->result as $key => $value) {
         $newKey = $pairs[$key];
         $array[$newKey] = $value;
     }
     $this->result = $array;
     $array2 = [];
     foreach ($this->total as $key => $value) {
         $newKey = $pairs[$key];
         $array2[$newKey] = $value;
     }
     $this->total = $array2;
     $this->planetTypeArray = Arrays::planetTypeArray();
 }
Пример #3
0
 function changeLocale($locale)
 {
     $this->headerName($locale);
     $this->planetTypeArray = Arrays::planetTypeArray();
 }