| @@ -59,7 +59,7 @@ | ||
| 59 | 59 | }'; | 
| 60 | 60 | |
| 61 | 61 | $view = $this->getView(); | 
| 62 | -        $view->registerJsFile('https://www.google.com/jsapi',['position' => View::POS_HEAD]); | |
| 62 | +        $view->registerJsFile('https://www.google.com/jsapi', ['position' => View::POS_HEAD]); | |
| 63 | 63 |          $view->registerJs('google.load("visualization", "' . $this->loadVersion . '", {packages:["' . $this->packages . '"]});', View::POS_HEAD, __CLASS__ . '#' . $id); | 
| 64 | 64 | $view->registerJs($script, View::POS_HEAD, $id); | 
| 65 | 65 | } | 
| @@ -5,5 +5,5 @@ | ||
| 5 | 5 | |
| 6 | 6 | class ChartPizza extends GoogleChart | 
| 7 | 7 |  { | 
| 8 | - public $visualization = 'PieChart'; | |
| 8 | + public $visualization = 'PieChart'; | |
| 9 | 9 | } | 
| 10 | 10 | \ No newline at end of file | 
| @@ -5,5 +5,5 @@ | ||
| 5 | 5 | |
| 6 | 6 | class ChartPie extends GoogleChart | 
| 7 | 7 |  { | 
| 8 | - public $visualization = 'PieChart'; | |
| 8 | + public $visualization = 'PieChart'; | |
| 9 | 9 | } | 
| 10 | 10 | \ No newline at end of file | 
| @@ -5,5 +5,5 @@ | ||
| 5 | 5 | |
| 6 | 6 | class ChartColumn extends GoogleChart | 
| 7 | 7 |  { | 
| 8 | - public $visualization = 'ColumnChart'; | |
| 8 | + public $visualization = 'ColumnChart'; | |
| 9 | 9 | } | 
| @@ -5,5 +5,5 @@ | ||
| 5 | 5 | |
| 6 | 6 | class ChartArea extends GoogleChart | 
| 7 | 7 |  { | 
| 8 | - public $visualization = 'AreaChart'; | |
| 8 | + public $visualization = 'AreaChart'; | |
| 9 | 9 | } | 
| @@ -5,5 +5,5 @@ | ||
| 5 | 5 | |
| 6 | 6 | class ChartLine extends GoogleChart | 
| 7 | 7 |  { | 
| 8 | - public $visualization = 'LineChart'; | |
| 8 | + public $visualization = 'LineChart'; | |
| 9 | 9 | } | 
| @@ -60,7 +60,7 @@ discard block | ||
| 60 | 60 | |
| 61 | 61 |          foreach ($this->dataProvider->models as $index => $model) { | 
| 62 | 62 | $allModels[$index] = []; | 
| 63 | -            foreach($this->columns as $column) { | |
| 63 | +            foreach ($this->columns as $column) { | |
| 64 | 64 | $allModels[$index][Inflector::slug($column, '_')] = ArrayHelper::getValue($model, $column, null); | 
| 65 | 65 | } | 
| 66 | 66 | } | 
| @@ -77,12 +77,12 @@ discard block | ||
| 77 | 77 | $allModels = []; | 
| 78 | 78 | $total = max(1, array_sum(array_map(fn($model) => next($model), $this->dataColumns))); | 
| 79 | 79 | |
| 80 | - foreach($this->dataColumns as $index => $model) | |
| 80 | + foreach ($this->dataColumns as $index => $model) | |
| 81 | 81 |          { | 
| 82 | 82 | $keys = array_keys($model); | 
| 83 | 83 | $key = next($keys); | 
| 84 | 84 | $allModels[$index] = $model; | 
| 85 | - $allModels[$index][$key] = ($model[$key]/$total) * 100; | |
| 85 | + $allModels[$index][$key] = ($model[$key] / $total) * 100; | |
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | 88 | return $allModels; | 
| @@ -91,16 +91,16 @@ discard block | ||
| 91 | 91 | protected function getData() | 
| 92 | 92 |      { | 
| 93 | 93 | // adapter as title as optional | 
| 94 | - $data = array($this->title? ['label_0', $this->title]: ['label_0']); | |
| 94 | + $data = array($this->title ? ['label_0', $this->title] : ['label_0']); | |
| 95 | 95 | |
| 96 | -        foreach($this->estimateData as $key => $model){ | |
| 96 | +        foreach ($this->estimateData as $key => $model) { | |
| 97 | 97 | // name column | 
| 98 | 98 | $data [$key + 1] = [strip_tags(array_shift($model))]; | 
| 99 | 99 | // values columns | 
| 100 | -            foreach($model as $attribute => $value) { | |
| 100 | +            foreach ($model as $attribute => $value) { | |
| 101 | 101 | $data[$key + 1][] = $value; | 
| 102 | 102 | // add columns legends | 
| 103 | -                if(count($data[0]) < count($data[$key + 1])) { | |
| 103 | +                if (count($data[0]) < count($data[$key + 1])) { | |
| 104 | 104 | $data[0][] = $attribute; | 
| 105 | 105 | } | 
| 106 | 106 | } |