function pPie::writeShiftedLabels

5.x pPie.class.php pPie::writeShiftedLabels()
4 calls to pPie::writeShiftedLabels()
pPie::draw2DPie in inc/pchart/pchart/class/pPie.class.php
pPie::draw2DRing in inc/pchart/pchart/class/pPie.class.php
pPie::draw3DPie in inc/pchart/pchart/class/pPie.class.php
pPie::draw3DRing in inc/pchart/pchart/class/pPie.class.php

File

inc/pchart/pchart/class/pPie.class.php, line 860

Class

pPie

Code

function writeShiftedLabels() 
 {
  if ($this->LabelPos == "") {
    return (0);
  }
  foreach ($this->LabelPos as $Key => $Settings) 
   {
    $X1 = $Settings ["X1"];
    $Y1 = $Settings ["Y1"];
    $X2 = $Settings ["X2"];
    $Y2 = $Settings ["Y2"];
    $X3 = $Settings ["X3"];
    $Angle = $Settings ["Angle"];
    $Label = $Settings ["Label"];

    $this->pChartObject->drawArrow($X2, $Y2, $X1, $Y1, array("Size" => 8));
    if ($Angle <= 180) 
     {
      $this->pChartObject->drawLine($X2, $Y2, $X3, $Y2);
      $this->pChartObject->drawText($X3 + 2, $Y2, $Label, array("Align" => TEXT_ALIGN_MIDDLELEFT));
    }
    else 
     {
      $this->pChartObject->drawLine($X2, $Y2, $X3, $Y2);
      $this->pChartObject->drawText($X3 -2, $Y2, $Label, array("Align" => TEXT_ALIGN_MIDDLERIGHT));
    }
  }
}