當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Axis::SetLabelSide方法代碼示例

本文整理匯總了PHP中Axis::SetLabelSide方法的典型用法代碼示例。如果您正苦於以下問題:PHP Axis::SetLabelSide方法的具體用法?PHP Axis::SetLabelSide怎麽用?PHP Axis::SetLabelSide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Axis的用法示例。


在下文中一共展示了Axis::SetLabelSide方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: StrokeAxis

 function StrokeAxis($aStrokeLabels = true)
 {
     if ($aStrokeLabels) {
         $this->StrokeAxisLabelBackground();
     }
     // Stroke axis
     if ($this->iAxisStyle != AXSTYLE_SIMPLE) {
         switch ($this->iAxisStyle) {
             case AXSTYLE_BOXIN:
                 $toppos = SIDE_DOWN;
                 $bottompos = SIDE_UP;
                 $leftpos = SIDE_RIGHT;
                 $rightpos = SIDE_LEFT;
                 break;
             case AXSTYLE_BOXOUT:
                 $toppos = SIDE_UP;
                 $bottompos = SIDE_DOWN;
                 $leftpos = SIDE_LEFT;
                 $rightpos = SIDE_RIGHT;
                 break;
             case AXSTYLE_YBOXIN:
                 $toppos = FALSE;
                 $bottompos = SIDE_UP;
                 $leftpos = SIDE_RIGHT;
                 $rightpos = SIDE_LEFT;
                 break;
             case AXSTYLE_YBOXOUT:
                 $toppos = FALSE;
                 $bottompos = SIDE_DOWN;
                 $leftpos = SIDE_LEFT;
                 $rightpos = SIDE_RIGHT;
                 break;
             default:
                 JpGRaphError::RaiseL(25036, $this->iAxisStyle);
                 //('Unknown AxisStyle() : '.$this->iAxisStyle);
                 break;
         }
         // By default we hide the first label so it doesn't cross the
         // Y-axis in case the positon hasn't been set by the user.
         // However, if we use a box we always want the first value
         // displayed so we make sure it will be displayed.
         $this->xscale->ticks->SupressFirst(false);
         // Now draw the bottom X-axis
         $this->xaxis->SetPos('min');
         $this->xaxis->SetLabelSide(SIDE_DOWN);
         $this->xaxis->scale->ticks->SetSide($bottompos);
         $this->xaxis->Stroke($this->yscale, $aStrokeLabels);
         if ($toppos !== FALSE) {
             // We also want a top X-axis
             $this->xaxis = $this->xaxis;
             $this->xaxis->SetPos('max');
             $this->xaxis->SetLabelSide(SIDE_UP);
             // No title for the top X-axis
             if ($aStrokeLabels) {
                 $this->xaxis->title->Set('');
             }
             $this->xaxis->scale->ticks->SetSide($toppos);
             $this->xaxis->Stroke($this->yscale, $aStrokeLabels);
         }
         // Stroke the left Y-axis
         $this->yaxis->SetPos('min');
         $this->yaxis->SetLabelSide(SIDE_LEFT);
         $this->yaxis->scale->ticks->SetSide($leftpos);
         $this->yaxis->Stroke($this->xscale, $aStrokeLabels);
         // Stroke the  right Y-axis
         $this->yaxis->SetPos('max');
         // No title for the right side
         if ($aStrokeLabels) {
             $this->yaxis->title->Set('');
         }
         $this->yaxis->SetLabelSide(SIDE_RIGHT);
         $this->yaxis->scale->ticks->SetSide($rightpos);
         $this->yaxis->Stroke($this->xscale, $aStrokeLabels);
     } else {
         $this->xaxis->Stroke($this->yscale, $aStrokeLabels);
         $this->yaxis->Stroke($this->xscale, $aStrokeLabels);
     }
 }
開發者ID:necrogami,項目名稱:JpGraph,代碼行數:78,代碼來源:jpgraph.php


注:本文中的Axis::SetLabelSide方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。