コード例 #1
0
 function __construct($min, $max, $type = "y")
 {
     parent::__construct($min, $max, $type);
     $this->ticks = new LogTicks();
     $this->name = 'log';
 }
コード例 #2
0
ファイル: jpgraph_polar.php プロジェクト: kractos26/orfeo
 function _Translate($v)
 {
     return parent::Translate($v);
 }
コード例 #3
0
ファイル: jpgraph.php プロジェクト: necrogami/JpGraph
 function _StrokeTicks(Image $aImg, LinearScale $aScale, $aPos)
 {
     $hor = $aScale->type == 'x';
     $aImg->SetLineWeight($this->weight);
     // We need to make this an int since comparing it below
     // with the result from round() can give wrong result, such that
     // (40 < 40) == TRUE !!!
     $limit = (int) $aScale->scale_abs[1];
     // A text scale doesn't have any minor ticks
     if (!$aScale->textscale) {
         // Stroke minor ticks
         $yu = $aPos - $this->direction * $this->GetMinTickAbsSize();
         $xr = $aPos + $this->direction * $this->GetMinTickAbsSize();
         $n = count($this->ticks_pos);
         for ($i = 0; $i < $n; ++$i) {
             if (!$this->supress_tickmarks && !$this->supress_minor_tickmarks) {
                 if ($this->mincolor != '') {
                     $aImg->PushColor($this->mincolor);
                 }
                 if ($hor) {
                     //if( $this->ticks_pos[$i] <= $limit )
                     $aImg->Line($this->ticks_pos[$i], $aPos, $this->ticks_pos[$i], $yu);
                 } else {
                     //if( $this->ticks_pos[$i] >= $limit )
                     $aImg->Line($aPos, $this->ticks_pos[$i], $xr, $this->ticks_pos[$i]);
                 }
                 if ($this->mincolor != '') {
                     $aImg->PopColor();
                 }
             }
         }
     }
     // Stroke major ticks
     $yu = $aPos - $this->direction * $this->GetMajTickAbsSize();
     $xr = $aPos + $this->direction * $this->GetMajTickAbsSize();
     $nbrmajticks = round(($aScale->GetMaxVal() - $aScale->GetMinVal() - $this->text_label_start) / $this->major_step) + 1;
     $n = count($this->maj_ticks_pos);
     for ($i = 0; $i < $n; ++$i) {
         if (!($this->xtick_offset > 0 && $i == $nbrmajticks - 1) && !$this->supress_tickmarks) {
             if ($this->majcolor != '') {
                 $aImg->PushColor($this->majcolor);
             }
             if ($hor) {
                 //if( $this->maj_ticks_pos[$i] <= $limit )
                 $aImg->Line($this->maj_ticks_pos[$i], $aPos, $this->maj_ticks_pos[$i], $yu);
             } else {
                 //if( $this->maj_ticks_pos[$i] >= $limit )
                 $aImg->Line($aPos, $this->maj_ticks_pos[$i], $xr, $this->maj_ticks_pos[$i]);
             }
             if ($this->majcolor != '') {
                 $aImg->PopColor();
             }
         }
     }
 }