Пример #1
0
	protected function drawLabels($drawer) {
		
		if($this->labelNumber !== NULL) {
			list($min, $max) = $this->range;
			$number = $this->labelNumber - 1;
			if($number < 1) {
				return;
			}
			$function = $this->rangeCallback['toValue'];
			$labels = array();
			for($i = 0; $i <= $number; $i++) {
				$labels[] = $function($i / $number, $min, $max);
			}
			$this->label->set($labels);
		}
		
		$labels = $this->label->count();
		
		for($i = 0; $i < $labels; $i++) {
		
			$p = $this->getPointFromValue($this->label->get($i));
			$this->label->draw($drawer, $p, $i);
		
		}
		
	}
Пример #2
0
 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid;
     echo '<td colspan="' . $this->cells . '"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
     $widget = new Cell("clc", "", 1, $this->width, 40);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new Label("lbl", $this->headline, "headbox", 1);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new FormImage($c["docroot"] . "modules/stats/widgets/statsimage.php?sid={$sid}&diagram=" . $this->diagramType . "&width=" . $this->width . "&height=" . $this->height . "&spid=" . $this->spid, $this->width, $this->height, 1);
     $widget->draw();
     // Draw Legend...
     echo "</tr><tr>\n";
     $widget = new Cell("clc", "", 1, $this->width, 10);
     $widget->draw();
     $colors[0] = __RED;
     $colors[1] = __BLUE;
     $colors[2] = __YELLOW;
     $colors[3] = __GREEN;
     for ($i = 0; $i < count($this->legend); $i++) {
         echo "</tr><tr><td>";
         echo '<table width="100%" border="0" cellpadding="2" cellspacing="0"><tr>';
         echo '<td width="10">' . ($i + 1) . '.</td>';
         echo '<td width="11">';
         echo '<table width="11" height="11" border="0" cellspacing="0" cellpadding="0"><tr><td style="background-color:' . $colors[$i] . ';">' . drawSpacer(11, 11) . '</td></tr></table>';
         echo '</td>';
         echo '<td>' . $this->legend[$i] . '</td>';
         echo '</tr></table></td>';
     }
     echo "</tr></table></td>";
     return $this->cells;
 }
 function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing)
 {
     $max = $this->getRealYMax();
     $min = $this->getRealYMin();
     // Get start and stop values
     list($start, $stop) = $this->getLimit();
     if ($this->lineMode === LINEPLOT_MIDDLE) {
         $inc = $this->xAxis->getDistance(0, 1) / 2;
     } else {
         $inc = 0;
     }
     // Build the polygon
     $polygon = new awPolygon();
     for ($key = $start; $key <= $stop; $key++) {
         $value = $this->datay[$key];
         if ($value !== NULL) {
             $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value));
             $p = $p->move($inc, 0);
             $polygon->set($key, $p);
         }
     }
     // Draw backgrounds
     if (is_a($this->lineBackground, 'awColor') or is_a($this->lineBackground, 'awGradient')) {
         $backgroundPolygon = new awPolygon();
         $p = $this->xAxisPoint($start);
         $p = $p->move($inc, 0);
         $backgroundPolygon->append($p);
         // Add others points
         foreach ($polygon->all() as $point) {
             $backgroundPolygon->append($point);
         }
         $p = $this->xAxisPoint($stop);
         $p = $p->move($inc, 0);
         $backgroundPolygon->append($p);
         // Draw polygon background
         $drawer->filledPolygon($this->lineBackground, $backgroundPolygon);
     }
     $this->drawArea($drawer, $polygon);
     // Draw line
     $prev = NULL;
     // Line color
     if ($this->lineHide === FALSE) {
         if ($this->lineColor === NULL) {
             $this->lineColor = new awColor(0, 0, 0);
         }
         foreach ($polygon->all() as $point) {
             if ($prev !== NULL) {
                 $drawer->line($this->lineColor, new awLine($prev, $point, $this->lineStyle, $this->lineThickness));
             }
             $prev = $point;
         }
         $this->lineColor->free();
     }
     // Draw marks and labels
     foreach ($polygon->all() as $key => $point) {
         $this->mark->draw($drawer, $point);
         $this->label->draw($drawer, $point, $key);
     }
 }
Пример #4
0
		/**
		 * Write HTML for the WUI-Object.
		 *
		 */
		function draw() {
			$dr3 = new Label("lbl", $this->text, "headbox", $this->columns);
			echo "<tr>";
			$dr3->draw();
			echo "</tr>";

			return $this->columns;
		}
Пример #5
0
	 function drawTitle() {
	
		$drawer = $this->getDrawer();
	
		$point = new awPoint(
			$this->width / 2,
			10
		);
		
		$this->title->draw($drawer, $point);
	
	}
Пример #6
0
 public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing)
 {
     $count = count($this->datay);
     $max = $this->getRealYMax(NULL);
     $min = $this->getRealYMin(NULL);
     // Find zero for bars
     if ($this->xAxisZero and $min <= 0 and $max >= 0) {
         $zero = 0;
     } else {
         if ($max < 0) {
             $zero = $max;
         } else {
             $zero = $min;
         }
     }
     // Get base position
     $zero = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint(0, $zero));
     // Distance between two values on the graph
     $distance = $this->xAxis->getDistance(0, 1);
     // Compute paddings
     $leftPadding = $this->barPadding->left * $distance;
     $rightPadding = $this->barPadding->right * $distance;
     $padding = $leftPadding + $rightPadding;
     $space = $this->barSpace * ($this->number - 1);
     $barSize = ($distance - $padding - $space) / $this->number;
     $barPosition = $leftPadding + $barSize * ($this->identifier - 1);
     for ($key = 0; $key < $count; $key++) {
         $value = $this->datay[$key];
         if ($value !== NULL) {
             $position = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value));
             $barStart = $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x;
             $barStop = $barStart + $barSize;
             $t1 = min($zero->y, $position->y);
             $t2 = max($zero->y, $position->y);
             if (round($t2 - $t1) == 0) {
                 continue;
             }
             $p1 = new awPoint(round($barStart) + $this->depth + $this->move->left, round($t1) - $this->depth + $this->move->top);
             $p2 = new awPoint(round($barStop) + $this->depth + $this->move->left, round($t2) - $this->depth + $this->move->top);
             $this->drawBar($drawer, $p1, $p2);
         }
     }
     // Draw labels
     foreach ($this->datay as $key => $value) {
         if ($value !== NULL) {
             $position = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value));
             $point = new awPoint($barPosition + ($this->identifier - 1) * $this->barSpace + $position->x + $barSize / 2 + 1 + $this->depth, $position->y - $this->depth);
             $this->label->draw($drawer, $point, $key);
         }
     }
 }
 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid;
     echo '<td colspan="' . $this->cells . '"><table width="600" border="0" cellpadding="0" cellspacing="0"><tr>';
     $widget = new Cell("clc", "", 2, $this->width, 20);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new Label("lbl", '<br><h3>' . $this->headline . '</h3>', '', 2);
     $widget->draw();
     echo "</tr>\n";
     echo $this->container;
     echo "</tr></table></td>";
     return $this->cells;
 }
Пример #8
0
 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid;
     echo '<td colspan="' . $this->cells . '" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
     $widget = new Cell("clc", "", 4, $this->width, 20);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new Label("lbl", $this->headline, "stats_headline", 4);
     $widget->draw();
     echo "</tr>\n";
     echo $this->container;
     echo "</tr></table></td>";
     return $this->cells;
 }
 public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing)
 {
     $count = count($this->datay);
     // Get start and stop values
     list($start, $stop) = $this->getLimit();
     // Build the polygon
     $polygon = new awPolygon();
     for ($key = 0; $key < $count; $key++) {
         $x = $this->datax[$key];
         $y = $this->datay[$key];
         if ($y !== NULL) {
             $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($x, $y));
             $polygon->set($key, $p);
         } else {
             if ($this->linkNull === FALSE) {
                 $polygon->set($key, NULL);
             }
         }
     }
     // Link points if needed
     if ($this->link) {
         $prev = NULL;
         foreach ($polygon->all() as $point) {
             if ($prev !== NULL and $point !== NULL) {
                 $drawer->line($this->lineColor, new awLine($prev, $point, $this->lineStyle, $this->lineThickness));
             }
             $prev = $point;
         }
         $this->lineColor->free();
     }
     // Draw impulses
     if ($this->impulse instanceof awColor) {
         foreach ($polygon->all() as $key => $point) {
             if ($point !== NULL) {
                 $zero = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, 0));
                 $drawer->line($this->impulse, new awLine($zero, $point, awLine::SOLID, 1));
             }
         }
     }
     // Draw marks and labels
     foreach ($polygon->all() as $key => $point) {
         $this->mark->draw($drawer, $point);
         $this->label->draw($drawer, $point, $key);
     }
 }
Пример #10
0
 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid, $lang;
     echo '<form name="form1">';
     echo '<td colspan="' . $this->cells . '"><table width="100%" border="0" cellpadding="3" cellspacing="0"><tr>';
     $widget = new Cell("clc", "", 2, $this->width, 20);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new Label("lbl", $this->headline, "stats_headline", 2);
     $widget->draw();
     echo "</tr>\n";
     echo "<tr><td colspan=\"" . $this->cells . "\" class=\"bcopy\">" . $lang->get("pta", "Select page to analyze:") . "</td></tr>";
     echo "<tr>";
     $this->sps->draw();
     echo "<td> ";
     $lbi = new LinkButton("action", $lang->get("go", "Go"), "navelement", "submit");
     $lbi->draw();
     retain("action", "");
     retain("sid", $sid);
     echo "</td></tr></table></td>";
     echo "</form>";
     return $this->cells;
 }
Пример #11
0
 function drawValues($image, Boundary $b)
 {
     $out = $this->getValuesArea($b);
     if ($out->width() < $this->depth || $out->height() < $this->depth || $out->left() > $out->right() || $out->top() > $out->bottom()) {
         throw new ChartException("Недостаточно места для вывода значений.");
     }
     $line = new Line(new Boundary(0, 0, 0, 0), $this->values['bgcolors'][0], $this->values['thickness']);
     $w = ($out->width() - $this->depth) / count($this->data);
     $l = new Label(new Boundary(0, 0, 0, 0), '', $this->values['font'], Color::getDefault(), Label::ALIGN_CENTER_MIDDLE);
     $e = new Ellipse(new Boundary(0, 0, $this->values['thickness'] * 3, $this->values['thickness'] * 3));
     for ($i = 0; $i < count($this->data); $i++) {
         $c = $out->left() + $w * $i + $w / 2.0;
         $line->bounds()->right($c);
         $line->bounds()->bottom($out->bottom() - ($this->data[$i] - $this->min) * $out->height() / ($this->max - $this->min));
         $line->background($this->values['bgcolors'][$i % count($this->values['bgcolors'])]);
         if ($i != 0) {
             $line->draw($image);
             $e->bounds()->move(new Size($line->bounds()->left() - $this->values['thickness'] * 3 / 2, $line->bounds()->top() - $this->values['thickness'] * 3 / 2));
             $e->background($this->values['bgcolors'][($i - 1) % count($this->values['bgcolors'])]);
             $e->draw($image);
         }
         $line->bounds()->left($line->bounds()->right());
         $line->bounds()->top($line->bounds()->bottom());
         if ($this->values['labels']) {
             $l->text($this->data[$i]);
             $l->bounds()->bottom($line->bounds()->top() - 5);
             $l->bounds()->top($l->bounds()->bottom() - $this->values['font']->getTextExtent()->height);
             $l->bounds()->left($line->bounds()->left());
             $l->bounds()->right($line->bounds()->left());
             $l->background($this->values['fgcolors'][$i % count($this->values['fgcolors'])]);
             $l->draw($image);
         }
     }
     $e->bounds()->move(new Size($line->bounds()->left() - $this->values['thickness'] * 3 / 2, $line->bounds()->top() - $this->values['thickness'] * 3 / 2));
     $e->background($line->background());
     $e->draw($image);
 }
Пример #12
0
		/** 
		 * Draw the control body
		 */
		function draw_body($parent = "0", $depth = 0) {
			$data = $this->getFunctionData($parent);

			for ($i = 0; $i < count($data); $i++) {
				echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";

				echo "<tr>";
				echo "<td width=\"25\">" . drawSpacer(1, 1). "</td>";
				echo "<td width=\"" . (250 - $depth * 25) . "\">" . drawSpacer(1, 1). "</td>";
				echo "<td width=\"300\">" . drawSpacer(1, 1). "</td>";
				echo "</tr>";

				if ($depth == 0) {
					echo "<tr>";

					echo "<td width=\"25\" style=\"border-bottom:1px solid black;\">" . drawSpacer(1, 1). "</td>";
					echo "<td width=\"250\" style=\"border-bottom:1px solid black;\">" . drawSpacer(1, 1). "</td>";
					echo "<td width=\"300\" style=\"border-bottom:1px solid black;\">" . drawSpacer(1, 1). "</td>";
					echo "</tr>";
				}

				echo "<tr>";

				if (in_array($data[$i][ID], $this->configData)) {
					$checked = true;
				} else {
					$checked = false;
				}

				$chkbox = new Checkbox($data[$i][ID], "1", "embedded", $checked);
				$chkbox->draw();
				$lbl = new Label("lbl", $data[$i][NAME], "bcopy");
				$lbl->draw();
				$lbl = new Label("lbl", $data[$i][DESC], "bcopy");
				$lbl->draw();
				echo "</tr>";

				echo "<tr>";
				echo "<td width=\"15\">" . drawSpacer(1, 1). "</td>";
				echo "<td colspan=\"2\">" . drawSpacer(1, 1);
				$this->draw_body($data[$i][ID], ($depth + 1));
				echo "</td>";
				echo "</tr>";
				echo "</table>";
			}
		}
Пример #13
0
 function drawValues($image, Boundary $b)
 {
     $out = $this->getValuesArea($b);
     if ($out->width() < $this->depth || $out->height() < $this->depth || $out->left() > $out->right() || $out->top() > $out->bottom()) {
         throw new ChartException("Недостаточно места для вывода значений.");
     }
     $r = new Rectangle3D(new Boundary(0, 0, 0, 0), NULL, Color::getDefault(), NULL, $this->depth);
     $w = ($out->width() - $this->depth) / count($this->data);
     $wr = $w / 1.5 - $this->depth;
     $l = new Label(new Boundary(0, 0, 0, 0), '', $this->values['font'], Color::getDefault(), Label::ALIGN_CENTER_MIDDLE);
     for ($i = 0; $i < count($this->data); $i++) {
         $c = $out->left() + $w * $i + $w / 2.0;
         $r->bounds()->left($c - $wr / 2);
         $r->bounds()->right($c + $wr / 2);
         $r->bounds()->top($out->bottom() - ($this->data[$i] - $this->min) * $out->height() / ($this->max - $this->min));
         $r->bounds()->bottom($out->bottom() - 1);
         $r->background($this->values['bgcolors'][$i % count($this->values['bgcolors'])]);
         $r->draw($image);
         $l->text($this->data[$i]);
         if (($h = $this->values['font']->getTextExtent()->height) > $r->bounds()->height()) {
             $r->bounds()->bottom($r->bounds()->top());
             $r->bounds()->top($r->bounds()->bottom() - $h);
         }
         if ($this->values['labels']) {
             $l->bounds($r->bounds());
             $l->background($this->values['fgcolors'][$i % count($this->values['fgcolors'])]);
             $l->draw($image);
         }
     }
 }
Пример #14
0
 function drawTitle($image, Boundary $b)
 {
     $s = $this->title['font']->getTextExtent($this->title['text']);
     //var_dump(imagettfbbox($this->title['font']->size,$this->title['font']->angle,$this->title['font']->family,$this->title['text']));
     //throw new exception ($s->height);
     if ($s->height > $b->height() || $s->width > $b->width()) {
         throw new ChartException("Недостаточно места для вывода заголовка.");
     }
     $b->bottom($b->top() + $s->height);
     $title = new Label($b, $this->title['text'], $this->title['font'], $this->title['color'], Label::ALIGN_CENTER_TOP);
     $title->draw($image);
 }
Пример #15
0
 public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing)
 {
     $count = count($this->values);
     $sum = array_sum($this->values);
     $width = $x2 - $x1;
     $height = $y2 - $y1;
     if ($aliasing) {
         $x = $width / 2;
         $y = $height / 2;
     } else {
         $x = $width / 2 + $x1;
         $y = $height / 2 + $y1;
     }
     $position = $this->angle;
     $values = array();
     $parts = array();
     $angles = 0;
     if ($aliasing) {
         $side = new awSide(0, 0, 0, 0);
     }
     foreach ($this->values as $key => $value) {
         $angle = $value / $sum * 360;
         if ($key === $count - 1) {
             $angle = 360 - $angles;
         }
         $angles += $angle;
         if (array_key_exists($key, $this->explode)) {
             $middle = 360 - ($position + $angle / 2);
             $posX = $this->explode[$key] * cos($middle * M_PI / 180);
             $posY = $this->explode[$key] * sin($middle * M_PI / 180) * -1;
             if ($aliasing) {
                 $explode = new awPoint($posX * 2, $posY * 2);
                 $side->set(max($side->left, $posX * -2), max($side->right, $posX * 2), max($side->top, $posY * -2), max($side->bottom, $posY * 2));
             } else {
                 $explode = new awPoint($posX, $posY);
             }
         } else {
             $explode = new awPoint(0, 0);
         }
         $values[$key] = array($position, $position + $angle, $explode);
         $color = $this->colors[$key % count($this->colors)];
         $parts[$key] = new awPiePart($color);
         // Add part to the legend
         $legend = array_key_exists($key, $this->legendValues) ? $this->legendValues[$key] : $key;
         $this->legend->add($parts[$key], $legend, awLegend::BACKGROUND);
         $position += $angle;
     }
     if ($aliasing) {
         $mainDrawer = $drawer;
         $x *= 2;
         $y *= 2;
         $width *= 2;
         $height *= 2;
         $this->size *= 2;
         $image = new awImage();
         $image->border->hide();
         $image->setSize($width + $side->left + $side->right, $height + $side->top + $side->bottom + $this->size + 1);
         $drawer = $image->getDrawer($width / $image->width, $height / $image->height, ($width / 2 + $side->left) / $image->width, ($height / 2 + $side->top) / $image->height);
     }
     // Draw 3D effect
     for ($i = $this->size; $i > 0; $i--) {
         foreach ($values as $key => $value) {
             $color = clone $this->colors[$key % count($this->colors)];
             $color->brightness(-50);
             list($from, $to, $explode) = $value;
             $drawer->filledArc($color, $explode->move($x, $y + $i), $width, $height, $from, $to);
             $color->free();
             unset($color);
             if ($this->border instanceof awColor) {
                 $point = $explode->move($x, $y);
                 if ($i === $this->size) {
                     $drawer->arc($this->border, $point->move(0, $this->size), $width, $height, $from, $to);
                 }
             }
         }
     }
     foreach ($values as $key => $value) {
         $color = $this->colors[$key % count($this->colors)];
         list($from, $to, $explode) = $value;
         $drawer->filledArc($color, $explode->move($x, $y), $width, $height, $from, $to);
         if ($this->border instanceof awColor) {
             $point = $explode->move($x, $y);
             $drawer->arc($this->border, $point, $width, $height, $from, $to);
         }
     }
     if ($aliasing) {
         $x = $x / 2 + $x1;
         $y = $y / 2 + $y1;
         $width /= 2;
         $height /= 2;
         $this->size /= 2;
         foreach ($values as $key => $value) {
             $old = $values[$key][2];
             $values[$key][2] = new awPoint($old->x / 2, $old->y / 2);
         }
         $mainDrawer->copyResizeImage($image, new awPoint($x1 - $side->left / 2, $y1 - $side->top / 2), new awPoint($x1 - $side->left / 2 + $image->width / 2, $y1 - $side->top / 2 + $image->height / 2), new awPoint(0, 0), new awPoint($image->width, $image->height), TRUE);
         $drawer = $mainDrawer;
     }
     // Get labels values
     $pc = array();
     foreach ($this->values as $key => $value) {
         $pc[$key] = round($value / $sum * 100, $this->precision);
     }
     if ($this->label->count() === 0) {
         // Check that there is no user defined values
         $this->label->set($pc);
     }
     $position = 0;
     foreach ($pc as $key => $value) {
         // Limit number of labels to display
         if ($position === $this->number) {
             break;
         }
         if (is_null($this->minimum) === FALSE and $value < $this->minimum) {
             continue;
         }
         $position++;
         list($from, $to, $explode) = $values[$key];
         $angle = $from + ($to - $from) / 2;
         $angleRad = (360 - $angle) * M_PI / 180;
         $point = new awPoint($x + $explode->x + cos($angleRad) * ($width / 2 + $this->position), $y + $explode->y - sin($angleRad) * ($height / 2 + $this->position));
         $angle %= 360;
         // We don't display labels on the 3D effect
         if ($angle > 0 and $angle < 180) {
             $point = $point->move(0, -1 * sin($angleRad) * $this->size);
         }
         if ($angle >= 45 and $angle < 135) {
             $this->label->setAlign(awLabel::CENTER, awLabel::BOTTOM);
         } else {
             if ($angle >= 135 and $angle < 225) {
                 $this->label->setAlign(awLabel::RIGHT, awLabel::MIDDLE);
             } else {
                 if ($angle >= 225 and $angle < 315) {
                     $this->label->setAlign(awLabel::CENTER, awLabel::TOP);
                 } else {
                     $this->label->setAlign(awLabel::LEFT, awLabel::MIDDLE);
                 }
             }
         }
         $this->label->draw($drawer, $point, $key);
     }
 }
Пример #16
0
 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid;
     echo '<td colspan="' . $this->cells . '" align="center"><table width="600" border="0" cellpadding="0" cellspacing="0"><tr>';
     $widget = new Label("lbl", '<br><br>' . $this->headline . '<br><br>', "h3", 2);
     $widget->draw();
     echo "</tr>\n";
     echo $this->container;
     echo "</tr></table></td>";
     return $this->cells;
 }
 /**
  * Finalize the drawing of the component
  */
 function finalize($drawer)
 {
     // Draw component title
     $point = new awPoint($this->w / 2, $this->padding->top - 8);
     $this->title->draw($drawer, $point);
     // Draw legend
     $this->legend->draw($drawer);
 }
 public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing)
 {
     $datayReal = $this->datay;
     $dataySkewed = array();
     for ($index = 0; $index < count($this->datay); $index++) {
         $dataySkewed[$index] = false;
     }
     if (count($this->datay) > 5) {
         for ($index = 0; $index < count($this->datay); $index++) {
             if ($index < 3) {
                 if ($this->datay[$index] * 0.5 > $this->datay[$index + 1] && $this->datay[$index + 1] != 0) {
                     $multiplyer = $this->datay[$index] * 0.5 / $this->datay[$index + 1];
                     for ($i = $index + 1; $i < count($this->datay); $i++) {
                         $this->datay[$i] = $this->datay[$i] * $multiplyer;
                     }
                     for ($i = $index; $i >= 0; $i--) {
                         $dataySkewed[$index] = true;
                     }
                 }
             }
         }
     }
     $count = count($this->datay);
     $max = $this->getRealYMax(NULL);
     $min = $this->getRealYMin(NULL);
     // Find zero for bars
     if ($this->xAxisZero and $min <= 0 and $max >= 0) {
         $zero = 0;
     } else {
         if ($max < 0) {
             $zero = $max;
         } else {
             $zero = $min;
         }
     }
     // Get base position
     $zero = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint(0, $zero));
     // Distance between two values on the graph
     $distance = $this->xAxis->getDistance(0, 1);
     // Compute paddings
     $leftPadding = $this->barPadding->left * $distance;
     $rightPadding = $this->barPadding->right * $distance;
     $padding = $leftPadding + $rightPadding;
     $space = $this->barSpace * ($this->number - 1);
     $barSize = ($distance - $padding - $space) / $this->number;
     $barPosition = $leftPadding + $barSize * ($this->identifier - 1);
     for ($key = 0; $key < $count; $key++) {
         $value = $this->datay[$key];
         if ($value !== NULL) {
             /* Determine if we should use cut symbol */
             $position = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value));
             $barStart = $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x;
             $barStop = $barStart + $barSize;
             $t1 = min($zero->y, $position->y);
             $t2 = max($zero->y, $position->y);
             if (round($t2 - $t1) == 0) {
                 continue;
             }
             if ($dataySkewed[$key]) {
                 $xmin = round($t1) - $this->depth + $this->move->top;
                 $xmax = round($t2) - $this->depth + $this->move->top;
                 $dividerPoint = ($xmax - $xmin) * 0.2 + $xmin;
                 $p1x = round($barStart) + $this->depth + $this->move->left;
                 $p1y = round($t1) - $this->depth + $this->move->top;
                 $p2x = round($barStop) + $this->depth + $this->move->left;
                 $p2y = round($t2) - $this->depth + $this->move->top;
                 $p1 = new awPoint($p1x, $p1y);
                 $p2 = new awPoint($p2x, $p2y);
                 $this->drawBar($drawer, $p1, $p2, $key);
                 $lineX = round($barStop) + $this->depth + $this->move->left;
                 $lineY = $dividerPoint;
                 /* Draw a two-pixel white line over the bar at the divider point. */
                 $white = imagecolorallocate($drawer->resource, 255, 255, 255);
                 imageline($drawer->resource, $lineX - $barSize + 1, $lineY, $lineX + 1, $lineY, $white);
                 imageline($drawer->resource, $lineX - $barSize + 1, $lineY + 1, $lineX + 1, $lineY + 1, $white);
             } else {
                 $p1 = new awPoint(round($barStart) + $this->depth + $this->move->left, round($t1) - $this->depth + $this->move->top);
                 $p2 = new awPoint(round($barStop) + $this->depth + $this->move->left, round($t2) - $this->depth + $this->move->top);
                 $this->drawBar($drawer, $p1, $p2, $key);
             }
         }
     }
     $maxValue = $this->maxValue;
     // Draw labels
     foreach ($datayReal as $key => $value) {
         if ($value !== NULL) {
             if ($value > $maxValue) {
                 $maxValue = $value;
             }
             $position = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $this->datay[$key]));
             $position2 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $this->datay[$key] / 2));
             $point = new awPoint($barPosition + ($this->identifier - 1) * $this->barSpace + $position->x + $barSize / 2 + 1 + $this->depth, $position->y - $this->depth);
             $point2 = new awPoint($barPosition + ($this->identifier - 1) * $this->barSpace + $position2->x + $barSize / 2 + 1 + $this->depth, $position2->y - $this->depth);
             if ($maxValue == 0) {
                 $maxValue = 1;
             }
             if ($value != 0 && $this->drawPercent) {
                 $this->label->drawSpecial($drawer, $point2, $key, '' . round($value / $maxValue * 100, 0) . '%');
                 $this->label->draw($drawer, $point, $key);
             }
         }
     }
 }