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


PHP Axis::getDistance方法代碼示例

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


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

示例1: drawEnvelope

 public function drawEnvelope(awDriver $driver)
 {
     list($x1, $y1, $x2, $y2) = $this->getPosition();
     if ($this->getXCenter()) {
         $size = $this->xAxis->getDistance(0, 1);
         $this->xAxis->label->move($size / 2, 0);
         $this->xAxis->label->hideLast(TRUE);
     }
     // Draw top axis
     if ($this->xAxisPosition === awPlot::TOP or $this->xAxisPosition === awPlot::BOTH) {
         $top = clone $this->xAxis;
         if ($this->xAxisZero === FALSE) {
             $top->line->setY($y1, $y1);
         }
         $top->label->setAlign(NULL, awLabel::TOP);
         $top->label->move(0, -3);
         $top->title->move(0, -25);
         $top->draw($driver);
     }
     // Draw bottom axis
     if ($this->xAxisPosition === awPlot::BOTTOM or $this->xAxisPosition === awPlot::BOTH) {
         $bottom = clone $this->xAxis;
         if ($this->xAxisZero === FALSE) {
             $bottom->line->setY($y2, $y2);
         }
         $bottom->label->setAlign(NULL, awLabel::BOTTOM);
         $bottom->label->move(0, 3);
         $bottom->reverseTickStyle();
         $bottom->title->move(0, 25);
         $bottom->draw($driver);
     }
     // Draw left axis
     if ($this->yAxisPosition === awPlot::LEFT or $this->yAxisPosition === awPlot::BOTH) {
         $left = clone $this->yAxis;
         if ($this->yAxisZero === FALSE) {
             $left->line->setX($x1, $x1);
         }
         $left->label->setAlign(awLabel::RIGHT);
         $left->label->move(-6, 0);
         $left->title->move(-25, 0);
         $left->draw($driver);
     }
     // Draw right axis
     if ($this->yAxisPosition === awPlot::RIGHT or $this->yAxisPosition === awPlot::BOTH) {
         $right = clone $this->yAxis;
         if ($this->yAxisZero === FALSE) {
             $right->line->setX($x2, $x2);
         }
         $right->label->setAlign(awLabel::LEFT);
         $right->label->move(6, 0);
         $right->reverseTickStyle();
         $right->title->move(25, 0);
         $right->draw($driver);
     }
 }
開發者ID:greench,項目名稱:prestashop,代碼行數:55,代碼來源:Plot.class.php


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