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))
{
if ($value > $largest)
{
$largest = $value;
}
}
}
while ($largest < ($this->num_lines_y - 1))
{
$largest = ($this->num_lines_y - 1);
}
$spread = ceil($largest / ($this->num_lines_y - 1));
$largest = $spread * ($this->num_lines_y - 1);*/
@ -286,8 +290,10 @@
{
print('<script language="JavaScript">');
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($this->ToURL() . '\', \'graph\', \'width=' . ($this->graph_width + 20) . ',height=' . ($this->graph_height + 20) . ',resizable=yes,scrollbars=yes\');');
print('</script>');
}
@ -310,7 +316,9 @@
$dataURL = explode('~', $GLOBALS['data']);
$this->data = array();
while (list($junk, $line) = each($dataURL))
{
$this->data[] = explode(',', $line);
}
$this->colors = explode(',', $GLOBALS['colors']);
$this->color_legend = explode(',', $GLOBALS['color_legend']);
@ -335,7 +343,9 @@
while(list($junk, $line) = each($this->data))
{
if ($dataURL != '')
{
$dataURL .= '~';
}
$dataURL .= implode(',', $line);
}
$url .= 'data=' . $dataURL . '&';

View File

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