cvs: pear /Image_Graph Graph.php
| From: | Tobias Schlitt | Date: | Tue, 17 Feb 2004 21:15:31 +0000 |
| Subject: | cvs: pear /Image_Graph Graph.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-16626@lists.php.net to get a copy of this message | ||
toby Tue Feb 17 16:15:31 2004 EDT
Modified files:
/pear/Image_Graph Graph.php
Log:
* Ongoing work.
http://cvs.php.net/diff.php/pear/Image_Graph/Graph.php?r1=1.26&r2=1.27&ty=u
Index: pear/Image_Graph/Graph.php
diff -u pear/Image_Graph/Graph.php:1.26 pear/Image_Graph/Graph.php:1.27
--- pear/Image_Graph/Graph.php:1.26 Mon Feb 16 16:38:23 2004
+++ pear/Image_Graph/Graph.php Tue Feb 17 16:15:31 2004
@@ -16,7 +16,7 @@
// | Author: Stefan Neufeind <pear.neufeind@speedpartner.de> |
// +----------------------------------------------------------------------+
//
-// $Id: Graph.php,v 1.26 2004/02/16 21:38:23 toby Exp $
+// $Id: Graph.php,v 1.27 2004/02/17 21:15:31 toby Exp $
/**
* Package for drawing graphs (bars, lines, ...)
@@ -327,8 +327,8 @@
$options['anti_aliasing'] = false;
}
$options['max_lines'] = 100;
- $options['width'] = $this->_size[0];
- $options['height'] = $this->_size[1];
+ $options['width'] = $this->_size[1];
+ $options['height'] = $this->_size[0];
$this->_defaultFontOptions = $options;
}
@@ -643,10 +643,8 @@
$text = (is_array($this->diagramTitle->_text)) ? implode('\n',
$this->diagramTitle->_text) : $this->diagramTitle->_text;
$tempText = new Image_Text($text, $this->diagramTitle->_fontOptions);
$tempText->init();
- var_dump($tempText);
$tempText->measurize();
$textSize = $tempText->_realTextSize;
- var_dump($textSize);
$borderspaceSum['top'] += $textSize['height'];
$borderspaceSum['top'] +=
$this->diagramTitle->_spacer['top'];
$borderspaceSum['top'] +=
$this->diagramTitle->_spacer['bottom'];
@@ -799,8 +797,8 @@
if (!empty($this->diagramTitle->_text)) {
require_once 'Image/Text.php'; // already done in
_prepareInternalVariables() - but remember it's an require_once
$textX = $this->_pos[0] + ($this->_size[0] / 2);
- $textY = $this->_pos[1] + $this->_borderspace;
- $options = array_merge($this->diagramTitle->_fontOptions, array('x'
=> $textX, 'y' => $textY));
+ $textY = $this->_pos[1] + $this->_borderspace + 30;
+ $options = array_merge($this->diagramTitle->_fontOptions,
array('cx' => $textX, 'cy' => $textY));
/***********************************************************
@@ -812,11 +810,16 @@
$tempText->set('halign', IMAGE_TEXT_ALIGN_CENTER);
$tempText->set('canvas', $img);
$tempText->init();
-
+
$tempText->setColor(array ("r" =>
$this->diagramTitle->_color[0],
"g" =>
$this->diagramTitle->_color[1],
"b" =>
$this->diagramTitle->_color[2]));
- $tempText->render();
+ $tempText->measurize();
+ $tempText->set(array('width' =>
$tempText->_realTextSize['width'], 'height' =>
$tempText->_realTextSize['height']));
+ $tempText->init();
+ $tempText->measurize();
+ $tempText->render(true);
+ var_dump($tempText);
}
// draw x-axis text