formatting

This commit is contained in:
Miles Lott 2004-01-10 15:14:01 +00:00
parent e0e5763821
commit f61e52640f
2 changed files with 122 additions and 90 deletions

View File

@ -148,12 +148,16 @@
while (list($junk2, $value) = each($line)) while (list($junk2, $value) = each($line))
{ {
if ($value > $largest) if ($value > $largest)
{
$largest = $value; $largest = $value;
} }
} }
}
while ($largest < ($this->num_lines_y - 1)) while ($largest < ($this->num_lines_y - 1))
{
$largest = ($this->num_lines_y - 1); $largest = ($this->num_lines_y - 1);
}
$spread = ceil($largest / ($this->num_lines_y - 1)); $spread = ceil($largest / ($this->num_lines_y - 1));
$largest = $spread * ($this->num_lines_y - 1);*/ $largest = $spread * ($this->num_lines_y - 1);*/
@ -286,8 +290,10 @@
{ {
print('<script language="JavaScript">'); print('<script language="JavaScript">');
print('window.open(\'main.php3?menuAction=boGraph.Show&'); print('window.open(\'main.php3?menuAction=boGraph.Show&');
if (ereg('MSIE', $GLOBALS['HTTP_USER_AGENT'])) if(strstr($GLOBALS['HTTP_USER_AGENT'],'MSIE'))
{
print('DCLINFO=' . $GLOBALS['DCLINFO'] . '&'); print('DCLINFO=' . $GLOBALS['DCLINFO'] . '&');
}
print($this->ToURL() . '\', \'graph\', \'width=' . ($this->graph_width + 20) . ',height=' . ($this->graph_height + 20) . ',resizable=yes,scrollbars=yes\');'); print($this->ToURL() . '\', \'graph\', \'width=' . ($this->graph_width + 20) . ',height=' . ($this->graph_height + 20) . ',resizable=yes,scrollbars=yes\');');
print('</script>'); print('</script>');
} }
@ -310,7 +316,9 @@
$dataURL = explode('~', $GLOBALS['data']); $dataURL = explode('~', $GLOBALS['data']);
$this->data = array(); $this->data = array();
while (list($junk, $line) = each($dataURL)) while (list($junk, $line) = each($dataURL))
{
$this->data[] = explode(',', $line); $this->data[] = explode(',', $line);
}
$this->colors = explode(',', $GLOBALS['colors']); $this->colors = explode(',', $GLOBALS['colors']);
$this->color_legend = explode(',', $GLOBALS['color_legend']); $this->color_legend = explode(',', $GLOBALS['color_legend']);
@ -335,7 +343,9 @@
while(list($junk, $line) = each($this->data)) while(list($junk, $line) = each($this->data))
{ {
if ($dataURL != '') if ($dataURL != '')
{
$dataURL .= '~'; $dataURL .= '~';
}
$dataURL .= implode(',', $line); $dataURL .= implode(',', $line);
} }
$url .= 'data=' . $dataURL . '&'; $url .= 'data=' . $dataURL . '&';

View File

@ -116,9 +116,13 @@
if ($x >= 0 && $x <= $this->width && $y >= 0 && $y <= $this->height) if ($x >= 0 && $x <= $this->width && $y >= 0 && $y <= $this->height)
{ {
if ($linestyle == 'dashed') if ($linestyle == 'dashed')
{
ImageDashedLine($this->hImage, $this->cur_x, $this->cur_y, $x, $y, $this->hColor); ImageDashedLine($this->hImage, $this->cur_x, $this->cur_y, $x, $y, $this->hColor);
}
else else
{
ImageLine($this->hImage, $this->cur_x, $this->cur_y, $x, $y, $this->hColor); ImageLine($this->hImage, $this->cur_x, $this->cur_y, $x, $y, $this->hColor);
}
$this->cur_x = $x; $this->cur_x = $x;
$this->cur_y = $y; $this->cur_y = $y;
@ -134,9 +138,13 @@
if ($x1 >= 0 && $x1 <= $this->width && $y1 >= 0 && $y1 <= $this->height && $x2 >= 0 && $x2 <= $this->width && $y2 >= 0 && $y2 <= $this->height) if ($x1 >= 0 && $x1 <= $this->width && $y1 >= 0 && $y1 <= $this->height && $x2 >= 0 && $x2 <= $this->width && $y2 >= 0 && $y2 <= $this->height)
{ {
if ($linestyle == 'solid') if ($linestyle == 'solid')
{
ImageLine($this->hImage, $x1, $y1, $x2, $y2, $this->hColor); ImageLine($this->hImage, $x1, $y1, $x2, $y2, $this->hColor);
}
else else
{
ImageDashedLine($this->hImage, $x1, $y1, $x2, $y2, $this->hColor); ImageDashedLine($this->hImage, $x1, $y1, $x2, $y2, $this->hColor);
}
$this->cur_x = $x2; $this->cur_x = $x2;
$this->cur_y = $y2; $this->cur_y = $y2;
@ -213,7 +221,9 @@
function SetFont($font) function SetFont($font)
{ {
if ($font < 1 || $font > 5) if ($font < 1 || $font > 5)
{
return false; return false;
}
$this->font = $font; $this->font = $font;
@ -250,35 +260,47 @@
{ {
$this->cur_y += $textwidth / 2; $this->cur_y += $textwidth / 2;
if ($this->cur_y > $this->height) if ($this->cur_y > $this->height)
{
$this->cur_y = $this->height; $this->cur_y = $this->height;
} }
}
else else
{ {
$this->cur_x -= $textwidth / 2; $this->cur_x -= $textwidth / 2;
if ($this->cur_x < 0) if ($this->cur_x < 0)
{
$this->cur_x = 0; $this->cur_x = 0;
} }
} }
else if ($justification == 'right') }
elseif ($justification == 'right')
{ {
if ($direction == 'up') if ($direction == 'up')
{ {
$this->cur_y += $textwidth; $this->cur_y += $textwidth;
if ($this->cur_y > $this->height) if ($this->cur_y > $this->height)
{
$this->cur_y = $this->height; $this->cur_y = $this->height;
} }
}
else else
{ {
$this->cur_x -= $textwidth; $this->cur_x -= $textwidth;
if ($this->cur_x < 0) if ($this->cur_x < 0)
{
$this->cur_x = 0; $this->cur_x = 0;
} }
} }
}
if ($direction == 'up') if ($direction == 'up')
{
ImageStringUp($this->hImage, $this->font, $this->cur_x, $this->cur_y, $text, $this->hColor); ImageStringUp($this->hImage, $this->font, $this->cur_x, $this->cur_y, $text, $this->hColor);
}
else else
{
ImageString($this->hImage, $this->font, $this->cur_x, $this->cur_y, $text, $this->hColor); ImageString($this->hImage, $this->font, $this->cur_x, $this->cur_y, $text, $this->hColor);
}
return true; return true;
} }