Exemple #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;
 }
Exemple #2
0
 public function __construct()
 {
     $this->colors = [Color::BLUE(), Color::GREEN(), Color::RED(), Color::PURPLE(), Color::ORANGE(), Color::BROWN(), Color::PINK(), Color::YELLOW(), Color::GRAY()];
 }