Exemplo n.º 1
0
 private function getRatingScatterData()
 {
     $data = [new ScatterDataSet([new ScatterDataPoint(0, 0, 0.1), new ScatterDataPoint(10, 10, 0.1)], '', Color::fromHex('#ffffff'))];
     foreach ($this->goals as $goalId => $goal) {
         if (isset($this->achievedGoals[$goalId]) || isset($this->cancelledGoals[$goalId])) {
             continue;
         } else {
             if (isset($this->ratings[$goalId])) {
                 $rating = $this->ratings[$goalId];
             } else {
                 $rating = new Rating(0, 0);
             }
         }
         $incompleteTasks = $this->getIncompleteTasks($goalId);
         if ($incompleteTasks) {
             if (!$this->getNextBrick($goalId)) {
                 $color = Color::PURPLE();
             } else {
                 $color = Color::GREEN();
             }
             $size = min(3, 0.5 + count($incompleteTasks) / 4);
         } else {
             $color = Color::RED();
             $size = 2;
         }
         $data[] = new ScatterDataSet([new ScatterDataPoint($rating->getUrgency(), $rating->getImportance(), $size)], $this->goals[$goalId]['name'], $color);
     }
     return $data;
 }
Exemplo n.º 2
0
 /**
  * @param Parameter $parameter
  * @param string $serialized
  * @return mixed
  */
 public function inflate(Parameter $parameter, $serialized)
 {
     return $serialized ? Color::fromHex($serialized) : null;
 }