@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace CMEN\GoogleChartsBundle\GoogleCharts; |
| 4 | 4 | |
| 5 | -use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; |
|
| 6 | -use CMEN\GoogleChartsBundle\GoogleCharts\Charts\Diff\DiffChart; |
|
| 5 | +use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; |
|
| 6 | +use CMEN\GoogleChartsBundle\GoogleCharts\Charts\Diff\DiffChart; |
|
| 7 | 7 | use CMEN\GoogleChartsBundle\GoogleCharts\Options\ChartOptionsDraw; |
| 8 | 8 | |
| 9 | 9 | /** |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function getName() |
| 48 | 48 | {
|
| 49 | - return 'chart' . ucfirst($this->elementID); |
|
| 49 | + return 'chart'.ucfirst($this->elementID); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function getDataName() |
| 58 | 58 | {
|
| 59 | - return 'data'. ucfirst($this->getName()); |
|
| 59 | + return 'data'.ucfirst($this->getName()); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function getOptionsName() |
| 68 | 68 | {
|
| 69 | - return 'options'. ucfirst($this->getName()); |
|
| 69 | + return 'options'.ucfirst($this->getName()); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -110,18 +110,18 @@ discard block |
||
| 110 | 110 | throw new GoogleChartsException('Container is not defined.');
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $js = 'var ' . $this->getName() . ' = new google.visualization.' . $this->getType() . |
|
| 114 | - '(document.getElementById("' . $this->elementID . '"));';
|
|
| 113 | + $js = 'var '.$this->getName().' = new google.visualization.'.$this->getType(). |
|
| 114 | + '(document.getElementById("'.$this->elementID.'"));';
|
|
| 115 | 115 | |
| 116 | 116 | if (!$this instanceof DiffChart) {
|
| 117 | 117 | $js .= $this->data->draw($this->getDataName()); |
| 118 | 118 | |
| 119 | 119 | } else {
|
| 120 | - $js .= $this->getOldChart()->getData()->draw('old_' . $this->getDataName()) .
|
|
| 121 | - $this->getNewChart()->getData()->draw('new_' . $this->getDataName()) .
|
|
| 122 | - 'var ' . $this->getDataName() . ' = ' . $this->getName() . |
|
| 123 | - '.computeDiff(old_' . $this->getDataName() . ', |
|
| 124 | - new_' . $this->getDataName() . ');'; |
|
| 120 | + $js .= $this->getOldChart()->getData()->draw('old_'.$this->getDataName()).
|
|
| 121 | + $this->getNewChart()->getData()->draw('new_'.$this->getDataName()).
|
|
| 122 | + 'var '.$this->getDataName().' = '.$this->getName(). |
|
| 123 | + '.computeDiff(old_'.$this->getDataName().', |
|
| 124 | + new_' . $this->getDataName().');'; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $js .= $this->options->draw($this->getOptionsName()); |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function endDraw() |
| 138 | 138 | {
|
| 139 | - return $this->events->draw(). $this->getName() . |
|
| 140 | - '.draw('. $this->getDataName() . ', '. $this->getOptionsName() .');';
|
|
| 139 | + return $this->events->draw().$this->getName(). |
|
| 140 | + '.draw('.$this->getDataName().', '.$this->getOptionsName().');';
|
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | /** |
| 66 | 66 | * @param $options OrgChartOptions |
| 67 | 67 | * |
| 68 | - * @return Map |
|
| 68 | + * @return OrgChart |
|
| 69 | 69 | */ |
| 70 | 70 | public function setOptions($options) |
| 71 | 71 | { |
@@ -55,8 +55,8 @@ |
||
| 55 | 55 | $lastKeyValue = key($row); |
| 56 | 56 | foreach ($row as $key => $value) {
|
| 57 | 57 | if ($value instanceof \DateTime) {
|
| 58 | - $js .= 'new Date(' . $value->format('Y') . ', ' . ($value->format('n')-1) . ', ' .
|
|
| 59 | - $value->format('d') . ')';
|
|
| 58 | + $js .= 'new Date('.$value->format('Y').', '.($value->format('n')-1).', '.
|
|
| 59 | + $value->format('d').')';
|
|
| 60 | 60 | } else {
|
| 61 | 61 | $js .= json_encode($value); |
| 62 | 62 | } |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | $js = ''; |
| 47 | 47 | |
| 48 | 48 | foreach ($this->listeners as $listener) { |
| 49 | - $js .= "google.visualization.events.addListener(" . $this->chart->getName() . ", '" . $listener->getType() . |
|
| 50 | - "', " . $listener->getFunction() . ");"; |
|
| 49 | + $js .= "google.visualization.events.addListener(".$this->chart->getName().", '".$listener->getType(). |
|
| 50 | + "', ".$listener->getFunction().");"; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return $js; |
@@ -40,6 +40,6 @@ |
||
| 40 | 40 | |
| 41 | 41 | $options = $this->optionsFormat->renameRecursivelyKeys($options); |
| 42 | 42 | |
| 43 | - return "var $optionsName = " . json_encode($options) . ";\n"; |
|
| 43 | + return "var $optionsName = ".json_encode($options).";\n"; |
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -95,7 +95,6 @@ |
||
| 95 | 95 | * - A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. |
| 96 | 96 | * - A state in the United States, specified by its ISO 3166-2:US code, e.g., 'US-AL' for Alabama. Note that |
| 97 | 97 | * the resolution option must be set to either 'provinces' or 'metros'. |
| 98 | - |
|
| 99 | 98 | * @var string |
| 100 | 99 | */ |
| 101 | 100 | protected $region; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | parent::__construct(); |
| 51 | 51 | |
| 52 | 52 | $this->timeline = new Timeline(); |
| 53 | - $this->tooltip = new BasicTooltip(); |
|
| 53 | + $this->tooltip = new BasicTooltip(); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function removeRecursivelyNullValue(&$options) |
| 18 | 18 | { |
| 19 | - $options = array_filter((array)$options, function ($val) { |
|
| 19 | + $options = array_filter((array)$options, function($val) { |
|
| 20 | 20 | return !is_null($val); |
| 21 | 21 | }); |
| 22 | 22 | |
@@ -95,7 +95,6 @@ |
||
| 95 | 95 | * - A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. |
| 96 | 96 | * - A state in the United States, specified by its ISO 3166-2:US code, e.g., 'US-AL' for Alabama. Note that |
| 97 | 97 | * the resolution option must be set to either 'provinces' or 'metros'. |
| 98 | - |
|
| 99 | 98 | * @var string |
| 100 | 99 | */ |
| 101 | 100 | protected $region; |