function pPie::writeShiftedLabels in Visitors 7
Same name and namespace in other branches
- 7.2 pChart/class/pPie.class.php \pPie::writeShiftedLabels()
4 calls to pPie::writeShiftedLabels()
- pPie::draw2DPie in pChart/
class/ pPie.class.php - pPie::draw2DRing in pChart/
class/ pPie.class.php - pPie::draw3DPie in pChart/
class/ pPie.class.php - pPie::draw3DRing in pChart/
class/ pPie.class.php
File
- pChart/
class/ pPie.class.php, line 860
Class
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,
));
}
}
}