コード例 #1
0
ファイル: SVGGraphRadarGraph.php プロジェクト: gotcms/gotcms
 /**
  * Calculates the position of grid lines
  */
 protected function CalcGrid()
 {
     if (isset($this->y_points)) {
         return;
     }
     $this->arad = (90 + $this->start_angle) * M_PI / 180;
     parent::CalcGrid();
     $grid_bottom = $this->height - $this->pad_bottom;
     $grid_left = $this->pad_left;
     // want only Y size, not actual position
     foreach ($this->y_points as $point => $ygrid) {
         $this->y_points[$point] = $grid_bottom - $ygrid;
     }
     if ($this->sub_y) {
         foreach ($this->y_subdivs as $point => $ygrid) {
             $this->y_subdivs[$point] = $grid_bottom - $ygrid;
         }
     }
     // same with X, only want distance
     foreach ($this->x_points as $point => $xgrid) {
         $new_x = $xgrid - $grid_left;
         $this->x_points[$point] = $new_x;
         $this->grid_angles[] = $this->arad + $new_x / $this->g_height;
     }
     if ($this->sub_x) {
         foreach ($this->x_subdivs as $point => $xgrid) {
             $new_x = $xgrid - $grid_left;
             $this->x_subdivs[$point] = $new_x;
             $this->grid_angles[] = $this->arad + $new_x / $this->g_height;
         }
     }
     // put the grid angles in order
     sort($this->grid_angles);
 }