From a9aa438ea0558eb0044cf1e54a9190ddb41b65e5 Mon Sep 17 00:00:00 2001 From: cassio Date: Tue, 2 Jul 2013 09:44:46 +0400 Subject: restructuring of boca's git --- .../src/libchart/classes/HorizontalChart.php | 169 --------------------- 1 file changed, 169 deletions(-) delete mode 100644 boca-1.5.1/src/libchart/classes/HorizontalChart.php (limited to 'boca-1.5.1/src/libchart/classes/HorizontalChart.php') diff --git a/boca-1.5.1/src/libchart/classes/HorizontalChart.php b/boca-1.5.1/src/libchart/classes/HorizontalChart.php deleted file mode 100644 index 4b4e069..0000000 --- a/boca-1.5.1/src/libchart/classes/HorizontalChart.php +++ /dev/null @@ -1,169 +0,0 @@ -setLabelMarginLeft(150); - $this->setLabelMarginRight(30); - $this->setLabelMarginTop(40); - $this->setLabelMarginBottom(30); - } - - /** - * Print the axis - * - * @access private - */ - - function printAxis() - { - // Check if some points were defined - - if(!$this->sampleCount) - return; - - $minValue = $this->axis->getLowerBoundary(); - $maxValue = $this->axis->getUpperBoundary(); - $stepValue = $this->axis->getTics(); - - // Horizontal axis - - for($value = $minValue; $value <= $maxValue; $value += $stepValue) - { - $x = $this->graphTLX + ($value - $minValue) * ($this->graphBRX - $this->graphTLX) / ($this->axis->displayDelta); - - imagerectangle($this->img, $x - 1, $this->graphBRY + 2, $x, $this->graphBRY + 3, $this->axisColor1->getColor($this->img)); - imagerectangle($this->img, $x - 1, $this->graphBRY, $x, $this->graphBRY + 1, $this->axisColor2->getColor($this->img)); - - $this->text->printText($this->img, $x, $this->graphBRY + 5, $this->textColor, $value, $this->text->fontCondensed, $this->text->HORIZONTAL_CENTER_ALIGN); - } - - // Vertical Axis - - $rowHeight = ($this->graphBRY - $this->graphTLY) / $this->sampleCount; - - reset($this->point); - - for($i = 0; $i <= $this->sampleCount; $i++) - { - $y = $this->graphBRY - $i * $rowHeight; - - imagerectangle($this->img, $this->graphTLX - 3, $y, $this->graphTLX - 2, $y + 1, $this->axisColor1->getColor($this->img)); - imagerectangle($this->img, $this->graphTLX - 1, $y, $this->graphTLX, $y + 1, $this->axisColor2->getColor($this->img)); - - if($i < $this->sampleCount) - { - $point = current($this->point); - next($this->point); - - $text = $point->getX(); - - $this->text->printText($this->img, $this->graphTLX - 5, $y - $rowHeight / 2, $this->textColor, $text, $this->text->fontCondensed, $this->text->HORIZONTAL_RIGHT_ALIGN | $this->text->VERTICAL_CENTER_ALIGN); - } - } - } - - /** - * Print the bars - * - * @access private - */ - - function printBar() - { - // Check if some points were defined - - if(!$this->sampleCount) - return; - - reset($this->point); - - $minValue = $this->axis->getLowerBoundary(); - $maxValue = $this->axis->getUpperBoundary(); - $stepValue = $this->axis->getTics(); - - $rowHeight = ($this->graphBRY - $this->graphTLY) / $this->sampleCount; - - for($i = 0; $i < $this->sampleCount; $i++) - { - $y = $this->graphBRY - $i * $rowHeight; - - $point = current($this->point); - next($this->point); - - $value = $point->getY(); - - $xmax = $this->graphTLX + ($value - $minValue) * ($this->graphBRX - $this->graphTLX) / ($this->axis->displayDelta); - - $this->text->printText($this->img, $xmax + 5, $y - $rowHeight / 2, $this->textColor, $value, $this->text->fontCondensed, $this->text->VERTICAL_CENTER_ALIGN); - - // Horizontal bar - - $y1 = $y - $rowHeight * 4 / 5; - $y2 = $y - $rowHeight * 1 / 5; - - imagefilledrectangle($this->img, $this->graphTLX + 1, $y1, $xmax, $y2, $this->barColor2->getColor($this->img)); - imagefilledrectangle($this->img, $this->graphTLX + 2, $y1+1, $xmax - 4, $y2, $this->barColor1->getColor($this->img)); - } - } - - /** - * Render the chart image - * - * @access public - * @param string name of the file to render the image to (optional) - */ - - function render($fileName = null) - { - $this->computeBound(); - $this->computeLabelMargin(); - $this->createImage(); - $this->printLogo(); - $this->printTitle(); - $this->printAxis(); - $this->printBar(); - - if(isset($fileName)) - imagepng($this->img, $fileName); - else - imagepng($this->img); - } - } -?> -- cgit v1.2.3