Lines Matching refs:this

119 		$this->palette = Palette::defaultPalette();
121 $this->XSize = $XSize;
122 $this->YSize = $YSize;
124 $this->setFontProperties ( "tahoma.ttf", 8 );
126 $this->shadowProperties = ShadowProperties::FromDefaults();
128 $this->canvas = $canvas;
135 $this->ErrorReporting = TRUE;
136 $this->ErrorInterface = $Interface;
143 $this->FontName = $FontName;
144 $this->FontSize = $FontSize;
148 $this->palette = $newPalette;
159 $this->shadowProperties = ShadowProperties::FromSettings($XDistance,
170 $this->shadowProperties = ShadowProperties::FromDefaults();
191 $this->palette->colors[$ColorID] = new Color($Values[0],
204 $this->LineWidth = $Width;
205 $this->LineDotSize = $DotSize;
212 $this->GArea_X1 = $X1;
213 $this->GArea_Y1 = $Y1;
214 $this->GArea_X2 = $X2;
215 $this->GArea_Y2 = $Y2;
222 $this->canvas->drawFilledRectangle(new Point($this->GArea_X1, $this->GArea_Y1),
223 new Point($this->GArea_X2, $this->GArea_Y2),
225 $this->shadowProperties, FALSE );
226 $this->canvas->drawRectangle(new Point($this->GArea_X1, $this->GArea_Y1),
227 new Point($this->GArea_X2, $this->GArea_Y2),
231 $this->shadowProperties);
236 $SkewWidth = $this->GArea_Y2 - $this->GArea_Y1 - 1;
238 for($i = $this->GArea_X1 - $SkewWidth; $i <= $this->GArea_X2; $i = $i + 4) {
240 $Y1 = $this->GArea_Y2;
242 $Y2 = $this->GArea_Y1;
244 if ($X1 < $this->GArea_X1) {
245 $X1 = $this->GArea_X1;
246 $Y1 = $this->GArea_Y1 + $X2 - $this->GArea_X1 + 1;
249 if ($X2 >= $this->GArea_X2) {
250 $Y2 = $this->GArea_Y1 + $X2 - $this->GArea_X2 + 1;
251 $X2 = $this->GArea_X2 - 1;
254 $this->canvas->drawLine(new Point($X1, $Y1),
265 $this->drawGraphArea($style);
266 $this->drawGraphAreaGradient($style);
273 $this->VMin = NULL;
274 $this->VMax = NULL;
275 $this->VXMin = NULL;
276 $this->VXMax = NULL;
277 $this->Divisions = NULL;
278 $this->XDivisions = NULL;
285 $this->VMin = $VMin;
286 $this->VMax = $VMax;
287 $this->Divisions = $Divisions;
290 $this->VXMin = $VXMin;
291 $this->VXMax = $VXMax;
292 $this->XDivisions = $XDivisions;
301 $this->drawScale($data, $style, $Angle, $Decimals, $WithMargin, $SkipLabels, TRUE );
309 $this->validateData ( "drawScale", $Data->getData() );
311 $this->canvas->drawLine(new Point($this->GArea_X1, $this->GArea_Y1),
312 new Point($this->GArea_X1, $this->GArea_Y2),
316 $this->shadowProperties);
317 $this->canvas->drawLine(new Point($this->GArea_X1, $this->GArea_Y2),
318 new Point($this->GArea_X2, $this->GArea_Y2),
322 $this->shadowProperties);
324 if ($this->VMin == NULL && $this->VMax == NULL) {
325 $Divisions = $this->calculateDivisions($Data, $style);
327 $Divisions = $this->Divisions;
329 $this->DivisionCount = $Divisions;
331 $DataRange = $this->VMax - $this->VMin;
336 $this->DivisionHeight = ($this->GArea_Y2 - $this->GArea_Y1) / $Divisions;
337 $this->DivisionRatio = ($this->GArea_Y2 - $this->GArea_Y1) / $DataRange;
339 $this->GAreaXOffset = 0;
342 $this->DivisionWidth = ($this->GArea_X2 - $this->GArea_X1) / (count ( $Data->getData() ) - 1);
344 $this->DivisionWidth = ($this->GArea_X2 - $this->GArea_X1) / (count ( $Data->getData() ));
345 $this->GAreaXOffset = $this->DivisionWidth / 2;
348 $this->DivisionWidth = $this->GArea_X2 - $this->GArea_X1;
349 $this->GAreaXOffset = $this->DivisionWidth / 2;
352 $this->DataCount = count ( $Data->getData() );
357 $YPos = $this->GArea_Y2;
361 $this->canvas->drawLine(new Point($this->GArea_X2, $YPos),
362 new Point($this->GArea_X2 + 5, $YPos),
366 $this->shadowProperties);
368 $this->canvas->drawLine(new Point($this->GArea_X1, $YPos),
369 new Point($this->GArea_X1 - 5, $YPos),
373 $this->shadowProperties);
375 $Value = $this->VMin + ($i - 1) * (($this->VMax - $this->VMin) / $Divisions);
377 $Value = $this->convertValueForDisplay($Value,
381 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Value );
385 $this->canvas->drawText($this->FontSize, 0,
386 new Point($this->GArea_X2 + 10,
387 $YPos + ($this->FontSize / 2)),
389 $this->FontName,
392 if ($XMin < $this->GArea_X2 + 15 + $TextWidth || $XMin == NULL) {
393 $XMin = $this->GArea_X2 + 15 + $TextWidth;
396 $this->canvas->drawText($this->FontSize,
398 new Point($this->GArea_X1 - 10 - $TextWidth,
399 $YPos + ($this->FontSize / 2)),
401 $this->FontName,
404 if ($XMin > $this->GArea_X1 - 10 - $TextWidth || $XMin == NULL) {
405 $XMin = $this->GArea_X1 - 10 - $TextWidth;
409 $YPos = $YPos - $this->DivisionHeight;
414 …$Position = imageftbbox ( $this->FontSize, 90, $this->FontName, $Data->getDataDescription()->getYA…
416 $TextTop = (($this->GArea_Y2 - $this->GArea_Y1) / 2) + $this->GArea_Y1 + ($TextHeight / 2);
419 $this->canvas->drawText($this->FontSize, 90,
420 new Point($XMin + $this->FontSize,
422 $style->getColor(), $this->FontName,
427 $this->canvas->drawText($this->FontSize, 90,
428 new Point($XMin - $this->FontSize,
430 $style->getColor(), $this->FontName,
437 $XPos = $this->GArea_X1 + $this->GAreaXOffset;
442 $this->canvas->drawLine(new Point(floor($XPos), $this->GArea_Y2),
443 new Point(floor($XPos), $this->GArea_Y2 + 5),
447 $this->shadowProperties);
449 $Value = $this->convertValueForDisplay($Value,
453 $Position = imageftbbox ( $this->FontSize, $Angle, $this->FontName, $Value );
458 $YPos = $this->GArea_Y2 + 18;
459 $this->canvas->drawText($this->FontSize,
464 $this->FontName,
468 $YPos = $this->GArea_Y2 + 10 + $TextHeight;
470 $this->canvas->drawText($this->FontSize,
475 $this->FontName,
480 $this->canvas->drawText($this->FontSize,
485 $this->FontName,
495 $XPos = $XPos + $this->DivisionWidth;
501 $Position = imageftbbox ( $this->FontSize, 90,
502 $this->FontName,
505 $TextLeft = (($this->GArea_X2 - $this->GArea_X1) / 2) + $this->GArea_X1 + ($TextWidth / 2);
506 $this->canvas->drawText($this->FontSize, 0,
508 $YMax + $this->FontSize + 5),
509 $style->getColor(), $this->FontName,
533 $this->VMin = $dataArray[0] [$Data->getDataDescription()->values[0]];
534 $this->VMax = $dataArray[0] [$Data->getDataDescription()->values[0]];
536 $this->VMin = 2147483647;
537 $this->VMax = - 2147483647;
544 $this->VMin = 0;
553 if ($this->VMax < $Value) {
554 $this->VMax = $Value;
556 if ($this->VMin > $Value) {
557 $this->VMin = $Value;
565 $this->VMin = 0;
578 if ($this->VMax < $Sum) {
579 $this->VMax = $Sum;
581 if ($this->VMin > $Sum) {
582 $this->VMin = $Sum;
587 $this->VMax = ceil($this->VMax);
590 if ($this->VMax == $this->VMin) {
591 if ($this->VMax >= 0) {
592 $this->VMax ++;
594 $this->VMin --;
598 $DataRange = $this->VMax - $this->VMin;
603 $this->calculateScales($Scale, $Divisions);
619 $this->validateData ( "drawScale", $Data->getData());
621 $this->canvas->drawLine(new Point($this->GArea_X1, $this->GArea_Y1),
622 new Point($this->GArea_X1, $this->GArea_Y2),
626 $this->shadowProperties);
627 $this->canvas->drawLine(new Point($this->GArea_X1, $this->GArea_Y2),
628 new Point($this->GArea_X2, $this->GArea_Y2),
632 $this->shadowProperties);
635 if ($this->VMin == NULL && $this->VMax == NULL) {
636 $this->VMin = $Data->getSeriesMin($YSerieName);
637 $this->VMax = $Data->getSeriesMax($YSerieName);
641 $this->VMax = ceil($this->VMax);
643 $DataRange = $this->VMax - $this->VMin;
648 self::computeAutomaticScaling($this->GArea_Y1,
649 $this->GArea_Y2,
650 $this->VMin,
651 $this->VMax,
654 $Divisions = $this->Divisions;
656 $this->DivisionCount = $Divisions;
658 $DataRange = $this->VMax - $this->VMin;
663 $this->DivisionHeight = ($this->GArea_Y2 - $this->GArea_Y1) / $Divisions;
664 $this->DivisionRatio = ($this->GArea_Y2 - $this->GArea_Y1) / $DataRange;
666 $YPos = $this->GArea_Y2;
669 $this->canvas->drawLine(new Point($this->GArea_X1, $YPos),
670 new Point($this->GArea_X1 - 5, $YPos),
674 $this->shadowProperties);
675 $Value = $this->VMin + ($i - 1) * (($this->VMax - $this->VMin) / $Divisions);
677 $Value = $this->convertValueForDisplay($Value,
681 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Value );
683 $this->canvas->drawText($this->FontSize,
685 new Point($this->GArea_X1 - 10 - $TextWidth,
686 $YPos + ($this->FontSize / 2)),
688 $this->FontName,
690 $this->shadowProperties);
692 if ($XMin > $this->GArea_X1 - 10 - $TextWidth || $XMin == NULL) {
693 $XMin = $this->GArea_X1 - 10 - $TextWidth;
696 $YPos = $YPos - $this->DivisionHeight;
700 if ($this->VXMin == NULL && $this->VXMax == NULL) {
701 $this->VXMax = $Data->getSeriesMax($XSerieName);
702 $this->VXMin = $Data->getSeriesMin($XSerieName);
704 $this->VXMax = ceil($this->VXMax);
706 $DataRange = $this->VMax - $this->VMin;
712 self::computeAutomaticScaling($this->GArea_X1, $this->GArea_X2,
713 $this->VXMin, $this->VXMax,
716 $XDivisions = $this->XDivisions;
718 $this->XDivisionCount = $Divisions;
719 $this->DataCount = $Divisions + 2;
721 $XDataRange = $this->VXMax - $this->VXMin;
726 $this->DivisionWidth = ($this->GArea_X2 - $this->GArea_X1) / $XDivisions;
727 $this->XDivisionRatio = ($this->GArea_X2 - $this->GArea_X1) / $XDataRange;
729 $XPos = $this->GArea_X1;
732 $this->canvas->drawLine(new Point($XPos, $this->GArea_Y2),
733 new Point($XPos, $this->GArea_Y2 + 5),
737 $this->shadowProperties);
739 $Value = $this->VXMin + ($i - 1) * (($this->VXMax - $this->VXMin) / $XDivisions);
742 $Value = $this->convertValueForDisplay($Value,
746 $Position = imageftbbox ( $this->FontSize, $Angle, $this->FontName, $Value );
751 $YPos = $this->GArea_Y2 + 18;
752 $this->canvas->drawText($this->FontSize,
757 $this->FontName,
759 $this->shadowProperties);
761 $YPos = $this->GArea_Y2 + 10 + $TextHeight;
763 $this->canvas->drawText($this->FontSize,
768 $this->FontName,
770 $this->shadowProperties);
773 $this->canvas->drawText($this->FontSize,
778 $this->FontName,
780 $this->shadowProperties);
788 $XPos = $XPos + $this->DivisionWidth;
793 $Position = imageftbbox ( $this->FontSize, 90, $this->FontName,
796 $TextTop = (($this->GArea_Y2 - $this->GArea_Y1) / 2) + $this->GArea_Y1 + ($TextHeight / 2);
797 $this->canvas->drawText($this->FontSize,
799 new Point($XMin - $this->FontSize,
802 $this->FontName,
804 $this->shadowProperties);
808 $this->writeScaleXAxisCaption($Data, $style, $YMax);
812 $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1;
826 $this->canvas->drawFilledRectangle(new Point($this->GArea_X1 + 1,
827 $this->GArea_Y1 + $YPos),
828 new Point($this->GArea_X2 - 1,
829 $this->GArea_Y1 + $LastY),
843 …$Position = imageftbbox ( $this->FontSize, 90, $this->FontName, $data->getDataDescription()->getXA…
845 $TextLeft = (($this->GArea_X2 - $this->GArea_X1) / 2) + $this->GArea_X1 + ($TextWidth / 2);
846 $this->canvas->drawText($this->FontSize,
849 $YMax + $this->FontSize + 5),
851 $this->FontName,
853 $this->shadowProperties);
864 $this->drawGridMosaic($style, $this->DivisionCount, $this->DivisionHeight);
868 $YPos = $this->GArea_Y2 - $this->DivisionHeight;
869 for($i = 1; $i <= $this->DivisionCount; $i ++) {
870 if ($YPos > $this->GArea_Y1 && $YPos < $this->GArea_Y2)
871 $this->canvas->drawDottedLine(new Point($this->GArea_X1, $YPos),
872 new Point($this->GArea_X2, $YPos),
874 $this->LineWidth,
883 $YPos = $YPos - $this->DivisionHeight;
887 if ($this->GAreaXOffset == 0) {
888 $XPos = $this->GArea_X1 + $this->DivisionWidth + $this->GAreaXOffset;
889 $ColCount = $this->DataCount - 2;
891 $XPos = $this->GArea_X1 + $this->GAreaXOffset;
892 $ColCount = floor ( ($this->GArea_X2 - $this->GArea_X1) / $this->DivisionWidth );
896 if ($XPos > $this->GArea_X1 && $XPos < $this->GArea_X2)
897 $this->canvas->drawDottedLine(new Point(floor($XPos), $this->GArea_Y1),
898 new Point(floor($XPos), $this->GArea_Y2),
900 $this->LineWidth,
902 $this->shadowProperties);
903 $XPos = $XPos + $this->DivisionWidth;
918 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Value );
945 $this->validateDataDescription("drawLegend", $DataDescription);
954 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Value );
966 $this->canvas->drawFilledRoundedRectangle(new Point($XPos + 1, $YPos + 1),
970 $this->LineWidth,
971 $this->LineDotSize,
972 $this->shadowProperties);
974 $this->canvas->drawFilledRoundedRectangle(new Point($XPos, $YPos),
978 $this->LineWidth,
979 $this->LineDotSize,
980 $this->shadowProperties);
983 $YOffset = 4 + $this->FontSize;
986 $this->canvas->drawFilledRoundedRectangle(new Point($XPos + 10,
991 $this->palette->colors[$ID],
992 $this->LineWidth,
993 $this->LineDotSize,
994 $this->shadowProperties);
995 $this->canvas->drawText($this->FontSize,
1000 $this->FontName,
1002 $this->shadowProperties);
1004 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Value );
1024 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Value );
1030 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Value );
1035 $this->canvas->drawText($this->FontSize,
1039 $this->FontName,
1063 $Position = imageftbbox ( $this->FontSize, $Angle, $this->FontName, $Text );
1070 $this->canvas->drawFilledRectangle($point1,
1076 $newPosition = $point1->addIncrement(1, $this->FontSize + 1);
1080 $this->FontSize + 1);
1084 $point1->getY() + $this->FontSize + 1);
1111 …$this->canvas->drawText($this->FontSize, $Angle, $newPosition, $color, $this->FontName, $Text, $sh…
1120 $Y = $this->GArea_Y2 - ($Value - $this->VMin) * $this->DivisionRatio;
1122 if ($Y <= $this->GArea_Y1 || $Y >= $this->GArea_Y2)
1126 $this->canvas->drawLine(new Point($this->GArea_X1, $Y),
1127 new Point($this->GArea_X2, $Y),
1129 $this->LineWidth,
1130 $this->LineDotSize,
1131 $this->shadowProperties);
1133 $this->canvas->drawDottedLine(new Point($this->GArea_X1, $Y),
1134 new Point($this->GArea_X2, $Y),
1136 $this->LineWidth,
1138 $this->shadowProperties);
1148 $position = new Point($this->GArea_X2 + 2,
1149 $Y + ($this->FontSize/ 2));
1152 $position = new Point($this->GArea_X1 + 2,
1153 $Y - ($this->FontSize / 2));
1156 $this->canvas->drawText($this->FontSize, 0,
1159 $this->FontName,
1174 $this->validateDataDescription ( "setLabel", $DataDescription );
1175 $this->validateData ( "setLabel", $Data );
1189 $XPos = $this->GArea_X1 + $this->GAreaXOffset + ($this->DivisionWidth * $Cp) + 2;
1190 $YPos = $this->GArea_Y2 - ($NumericalValue - $this->VMin) * $this->DivisionRatio;
1192 $Position = imageftbbox ( $this->FontSize, 0, $this->FontName, $Caption );
1200 $this->canvas->drawFilledPolygon($Poly,
1204 $this->canvas->drawLine(new Point($XPos, $YPos + 1),
1207 $this->LineWidth,
1208 $this->LineDotSize,
1209 $this->shadowProperties);
1211 $this->canvas->drawLine(new Point($XPos, $YPos + 1),
1214 $this->LineWidth,
1215 $this->LineDotSize,
1216 $this->shadowProperties);
1218 $this->canvas->drawFilledRectangle(new Point($XPos + 9,
1223 $this->shadowProperties);
1228 $this->canvas->drawFilledPolygon($Poly, 3, $color);
1232 $this->canvas->drawLine(new Point($XPos - 1, $YPos),
1235 $this->LineWidth,
1236 $this->LineDotSize,
1237 $this->shadowProperties);
1239 $this->canvas->drawLine(new Point($XPos - 1, $YPos),
1242 $this->LineWidth,
1243 $this->LineDotSize,
1244 $this->shadowProperties);
1245 $this->canvas->drawFilledRectangle(new Point($XPos + 8,
1250 $this->shadowProperties);
1252 $this->canvas->drawText($this->FontSize,
1256 $this->FontName,
1266 $this->validateDataDescription ( "drawPlotGraph", $DataDescription );
1267 $this->validateData ( "drawPlotGraph", $Data );
1275 $color = $this->palette->colors[$ColorID];
1285 $XPos = $this->GArea_X1 + $this->GAreaXOffset;
1291 $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio);
1294 if ($this->BuildMap)
1295 …$this->addToImageMap ( $XPos - $Hsize, $YPos - $Hsize, $XPos + 1 + $Hsize, $YPos + $Hsize + 1, $Da…
1302 $this->canvas->drawFilledCircle(new Point($XPos + 2,
1306 $this->shadowProperties);
1309 $color3 = $this->palette->colors[$ColorID]->addRGBIncrement(-20);
1311 $this->canvas->drawFilledCircle(new Point($XPos + 2,
1315 $this->shadowProperties);
1319 $this->canvas->drawFilledCircle(new Point($XPos + 1,
1323 $this->shadowProperties);
1327 $this->canvas->drawFilledCircle(new Point($XPos + 1,
1331 $this->shadowProperties);
1334 $color2 = $this->palette->colors[$ColorID]->addRGBIncrement(-15);
1336 $this->canvas->drawFilledCircle(new Point($XPos + 1,
1340 $this->shadowProperties);
1344 …imagecopymerge ( $this->canvas->getPicture(), $Symbol, $XPos + 1 - $ImageWidth / 2, $YPos + 1 - $I…
1348 $XPos = $XPos + $this->DivisionWidth;
1370 $color = $this->palette->colors[$PaletteID];
1380 $Y = $this->GArea_Y2 - (($Y - $this->VMin) * $this->DivisionRatio);
1381 $X = $this->GArea_X1 + (($X - $this->VXMin) * $this->XDivisionRatio);
1384 $br = $this->linearScale(
1399 $this->canvas->drawFilledCircle(new Point($X + 2, $Y + 2),
1402 $this->shadowProperties);
1405 $color3 = $this->palette->colors[$PaletteID]->addRGBIncrement(-20);
1406 $this->canvas->drawFilledCircle(new Point($X + 2, $Y + 2),
1409 $this->shadowProperties);
1413 $this->canvas->drawFilledCircle(new Point($X + 1, $Y + 1),
1416 $this->shadowProperties);
1419 $this->canvas->drawFilledCircle(new Point($X + 1, $Y + 1),
1422 $this->shadowProperties);
1425 $color2 = $this->palette->colors[$PaletteID]->addRGBIncrement(20);
1427 $this->canvas->drawFilledCircle(new Point($X + 1, $Y + 1),
1430 $this->shadowProperties);
1442 $this->validateData ( "drawArea", $Data );
1444 $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1;
1446 $XPos = $this->GAreaXOffset;
1451 $YPos1 = $LayerHeight - (($Value1 - $this->VMin) * $this->DivisionRatio);
1452 $YPos2 = $LayerHeight - (($Value2 - $this->VMin) * $this->DivisionRatio);
1456 $Points [] = $LastXPos + $this->GArea_X1;
1457 $Points [] = $LastYPos1 + $this->GArea_Y1;
1458 $Points [] = $LastXPos + $this->GArea_X1;
1459 $Points [] = $LastYPos2 + $this->GArea_Y1;
1460 $Points [] = $XPos + $this->GArea_X1;
1461 $Points [] = $YPos2 + $this->GArea_Y1;
1462 $Points [] = $XPos + $this->GArea_X1;
1463 $Points [] = $YPos1 + $this->GArea_Y1;
1465 $this->canvas->drawFilledPolygon($Points,
1475 $XPos = $XPos + $this->DivisionWidth;
1484 $this->validateDataDescription ( "writeValues", $DataDescription );
1485 $this->validateData ( "writeValues", $Data );
1494 $XPos = $this->GArea_X1 + $this->GAreaXOffset;
1499 $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio);
1501 $Positions = imagettfbbox ( $this->FontSize, 0, $this->FontName, $Value );
1506 $this->canvas->drawText($this->FontSize,
1509 $this->palette->colors[$ColorID],
1510 $this->FontName,
1514 $XPos = $XPos + $this->DivisionWidth;
1526 $this->validateDataDescription ( "drawLineGraph", $DataDescription );
1527 $this->validateData ( "drawLineGraph", $Data );
1534 $XPos = $this->GArea_X1 + $this->GAreaXOffset;
1539 $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio);
1542 if ($this->BuildMap)
1543 …$this->addToImageMap ( $XPos - 3, $YPos - 3, $XPos + 3, $YPos + 3, $DataDescription->description[$…
1549 $this->canvas->drawLine(new Point($XLast, $YLast),
1551 $this->palette->colors[$ColorID],
1552 $this->LineWidth,
1553 $this->LineDotSize,
1554 $this->shadowProperties,
1555 new Point($this->GArea_X1,
1556 $this->GArea_Y1),
1557 new Point($this->GArea_X2,
1558 $this->GArea_Y2));
1566 $XPos = $XPos + $this->DivisionWidth;
1578 $graphAreaMin = new Point($this->GArea_X1, $this->GArea_Y1);
1579 $graphAreaMax = new Point($this->GArea_X2, $this->GArea_Y2);
1588 $Y = $this->GArea_Y2 - (($Y - $this->VMin) * $this->DivisionRatio);
1589 $X = $this->GArea_X1 + (($X - $this->VXMin) * $this->XDivisionRatio);
1594 $this->canvas->drawLine($lastPoint,
1596 $this->palette->colors[$PaletteID],
1597 $this->LineWidth,
1598 $this->LineDotSize,
1599 $this->shadowProperties,
1614 $this->validateDataDescription("drawCubicCurve",
1616 $this->validateData ( "drawCubicCurve", $data->getData() );
1618 $graphAreaMin = new Point($this->GArea_X1, $this->GArea_Y1);
1619 $graphAreaMax = new Point($this->GArea_X2, $this->GArea_Y2);
1646 $this->calculateCubicCurve($Yt, $XIn, $YIn, $U, $Index);
1653 $XPos = $this->GArea_X1 + $this->GAreaXOffset;
1693 $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio);
1696 $this->canvas->drawLine(new Point($XLast,
1700 $this->palette->colors[$ColorID],
1701 $this->LineWidth,
1702 $this->LineDotSize,
1703 $this->shadowProperties,
1709 $XPos = $XPos + $this->DivisionWidth * $Accuracy;
1713 $XPos = $XPos - $this->DivisionWidth * $Accuracy;
1714 if ($XPos < ($this->GArea_X2 - $this->GAreaXOffset)) {
1715 $YPos = $this->GArea_Y2 - (($YIn [$Index] - $this->VMin) * $this->DivisionRatio);
1716 $this->canvas->drawLine(new Point($XLast,
1718 new Point($this->GArea_X2 - $this->GAreaXOffset,
1720 $this->palette->colors[$ColorID],
1721 $this->LineWidth,
1722 $this->LineDotSize,
1723 $this->shadowProperties,
1762 $this->validateDataDescription("drawFilledCubicCurve",
1764 $this->validateData ( "drawFilledCubicCurve", $data->getData() );
1766 $LayerWidth = $this->GArea_X2 - $this->GArea_X1;
1767 $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1;
1768 $YZero = $LayerHeight - ((0 - $this->VMin) * $this->DivisionRatio);
1792 $this->calculateCubicCurve($Yt, $XIn, $YIn, $U, $numElements);
1800 $Points [] = $this->GAreaXOffset + $this->GArea_X1;
1801 $Points [] = $LayerHeight + $this->GArea_Y1;
1804 $XPos = $this->GAreaXOffset;
1824 $YPos = $LayerHeight - (($Value - $this->VMin) * $this->DivisionRatio);
1829 $aPoints [] = $XLast + $this->GArea_X1;
1830 $aPoints [] = min($YLast + $this->GArea_Y1, $this->GArea_Y2);
1831 $aPoints [] = $XPos + $this->GArea_X1;
1832 $aPoints [] = min($YPos + $this->GArea_Y1, $this->GArea_Y2);
1833 $aPoints [] = $XPos + $this->GArea_X1;
1834 $aPoints [] = $YZero + $this->GArea_Y1;
1835 $aPoints [] = $XLast + $this->GArea_X1;
1836 $aPoints [] = $YZero + $this->GArea_Y1;
1838 $this->canvas->drawFilledPolygon($aPoints,
1840 $this->palette->colors[$ColorID],
1846 $Points [] = $XPos + $this->GArea_X1;
1847 $Points [] = min($YPos + $this->GArea_Y1, $this->GArea_Y2);
1850 $Points [] = $XLast + $this->GArea_X1;
1851 $Points [] = min($LayerHeight + $this->GArea_Y1,
1852 $this->GArea_Y2);;
1857 $XPos = $XPos + $this->DivisionWidth * $Accuracy;
1861 $XPos = $XPos - $this->DivisionWidth * $Accuracy;
1862 if ($XPos < ($LayerWidth - $this->GAreaXOffset)) {
1863 $YPos = $LayerHeight - (($YIn [$numElements] - $this->VMin) * $this->DivisionRatio);
1866 $aPoints [] = $XLast + $this->GArea_X1;
1867 $aPoints [] = max($YLast + $this->GArea_Y1, $this->GArea_Y1);
1868 $aPoints [] = $LayerWidth - $this->GAreaXOffset + $this->GArea_X1;
1869 $aPoints [] = max($YPos + $this->GArea_Y1, $this->GArea_Y1);
1870 $aPoints [] = $LayerWidth - $this->GAreaXOffset + $this->GArea_X1;
1871 $aPoints [] = max($YZero + $this->GArea_Y1, $this->GArea_Y1);
1872 $aPoints [] = $XLast + $this->GArea_X1;
1873 $aPoints [] = max($YZero + $this->GArea_Y1, $this->GArea_Y1);
1875 $this->canvas->drawFilledPolygon($aPoints,
1877 $this->palette->colors[$ColorID],
1884 - $this->GAreaXOffset
1885 + $this->GArea_X1;
1886 $Points [] = $YPos + $this->GArea_Y1;
1890 $Points [] = $LayerWidth - $this->GAreaXOffset + $this->GArea_X1;
1891 $Points [] = $LayerHeight + $this->GArea_Y1;
1894 $this->canvas->drawFilledPolygon($Points,
1896 $this->palette->colors[$ColorID],
1900 $this->drawCubicCurve($data, $Accuracy, $ColName );
1913 $this->validateDataDescription ( "drawFilledLineGraph", $DataDescription );
1914 $this->validateData ( "drawFilledLineGraph", $Data );
1916 $LayerWidth = $this->GArea_X2 - $this->GArea_X1;
1917 $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1;
1924 $aPoints [] = $this->GAreaXOffset + $this->GArea_X1;
1925 $aPoints [] = $LayerHeight + $this->GArea_Y1;
1927 $XPos = $this->GAreaXOffset;
1930 $YZero = $LayerHeight - ((0 - $this->VMin) * $this->DivisionRatio);
1938 $YPos = $LayerHeight - (($Value - $this->VMin) * $this->DivisionRatio);
1941 if ($this->BuildMap)
1942 …$this->addToImageMap ( $XPos - 3, $YPos - 3, $XPos + 3, $YPos + 3, $DataDescription->description[$…
1946 $aPoints [] = $XLast + $this->GArea_X1;
1947 $aPoints [] = $LayerHeight + $this->GArea_Y1;
1953 $aPoints [] = $XPos + $this->GArea_X1;
1954 $aPoints [] = $YPos + $this->GArea_Y1;
1958 $aPoints [] = $XPos + $this->GArea_X1;
1959 $aPoints [] = $LayerHeight + $this->GArea_Y1;
1960 $aPoints [] = $XPos + $this->GArea_X1;
1961 $aPoints [] = $YPos + $this->GArea_Y1;
1966 $Points [] = $XLast + $this->GArea_X1;
1967 $Points [] = $YLast + $this->GArea_Y1;
1968 $Points [] = $XPos + $this->GArea_X1;
1969 $Points [] = $YPos + $this->GArea_Y1;
1970 $Points [] = $XPos + $this->GArea_X1;
1971 $Points [] = $YZero + $this->GArea_Y1;
1972 $Points [] = $XLast + $this->GArea_X1;
1973 $Points [] = $YZero + $this->GArea_Y1;
1975 $this->canvas->drawFilledPolygon($Points,
1977 $this->palette->colors[$ColorID],
1984 $XPos = $XPos + $this->DivisionWidth;
1986 $aPoints [] = $LayerWidth - $this->GAreaXOffset + $this->GArea_X1;
1987 $aPoints [] = $LayerHeight + $this->GArea_Y1;
1990 $this->canvas->drawFilledPolygon($aPoints,
1992 $this->palette->colors[$ColorID],
1997 $this->drawLineGraph ( $Data, $DataDescription, $ColName );
2006 $this->validateDataDescription ( "drawOverlayBarGraph", $DataDescription );
2007 $this->validateData ( "drawOverlayBarGraph", $Data );
2009 $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1;
2015 $XWidth = $this->DivisionWidth / 4;
2016 $XPos = $this->GAreaXOffset;
2017 $YZero = $LayerHeight - ((0 - $this->VMin) * $this->DivisionRatio);
2022 $YPos = $LayerHeight - (($Value - $this->VMin) * $this->DivisionRatio);
2024 $this->canvas->drawFilledRectangle(new Point(floor($XPos - $XWidth + $this->GArea_X1),
2025 floor($YPos + $this->GArea_Y1)),
2026 new Point(floor($XPos + $XWidth + $this->GArea_X1),
2027 floor($YZero + $this->GArea_Y1)),
2028 $this->palette->colors[$GraphID],
2033 $X1 = floor ( $XPos - $XWidth + $this->GArea_X1 );
2034 $Y1 = floor ( $YPos + $this->GArea_Y1 ) + .2;
2035 $X2 = floor ( $XPos + $XWidth + $this->GArea_X1 );
2036 $Y2 = $this->GArea_Y2 - ((0 - $this->VMin) * $this->DivisionRatio);
2037 if ($X1 <= $this->GArea_X1) {
2038 $X1 = $this->GArea_X1 + 1;
2040 if ($X2 >= $this->GArea_X2) {
2041 $X2 = $this->GArea_X2 - 1;
2045 if ($this->BuildMap)
2046 …$this->addToImageMap ( $X1, min ( $Y1, $Y2 ), $X2, max ( $Y1, $Y2 ), $DataDescription->description…
2048 $this->canvas->drawLine(new Point($X1,
2052 $this->palette->colors[$ColorID],
2053 $this->LineWidth,
2054 $this->LineDotSize,
2055 $this->shadowProperties,
2056 new Point($this->GArea_X1,
2057 $this->GArea_Y1),
2058 new Point($this->GArea_X2,
2059 $this->GArea_Y2));
2062 $XPos = $XPos + $this->DivisionWidth;
2074 $this->validateDataDescription ( "drawBarGraph", $DataDescription );
2075 $this->validateData ( "drawBarGraph", $Data );
2078 $SeriesWidth = $this->DivisionWidth / ($Series + 1);
2079 $SerieXOffset = $this->DivisionWidth / 2 - $SeriesWidth / 2;
2081 $YZero = $this->GArea_Y2 - ((0 - $this->VMin) * $this->DivisionRatio);
2082 if ($YZero > $this->GArea_Y2) {
2083 $YZero = $this->GArea_Y2;
2091 $XPos = $this->GArea_X1 + $this->GAreaXOffset - $SerieXOffset + $SeriesWidth * $SerieID;
2096 $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio);
2099 if ($this->BuildMap) {
2100 …$this->addToImageMap ( $XPos + 1, min ( $YZero, $YPos ), $XPos + $SeriesWidth - 1, max ( $YZero, $…
2104 $this->canvas->drawRectangle(new Point($XPos + 1, $YZero),
2108 $this->LineWidth,
2109 $this->LineDotSize,
2110 $this->shadowProperties);
2113 $this->canvas->drawFilledRectangle(new Point($XPos + 1,
2117 $this->palette->colors[$ColorID],
2118 $this->shadowProperties,
2122 $XPos = $XPos + $this->DivisionWidth;
2133 $this->validateDataDescription ( "drawBarGraph", $DataDescription );
2134 $this->validateData ( "drawBarGraph", $Data );
2137 $SeriesWidth = $this->DivisionWidth;
2139 $SeriesWidth = $this->DivisionWidth * .8;
2141 $YZero = $this->GArea_Y2 - ((0 - $this->VMin) * $this->DivisionRatio);
2142 if ($YZero > $this->GArea_Y2) {
2143 $YZero = $this->GArea_Y2;
2151 $XPos = $this->GArea_X1 + $this->GAreaXOffset - $SeriesWidth / 2;
2158 … $YPos = $this->GArea_Y2 - ((($Value + $LastValue [$Key]) - $this->VMin) * $this->DivisionRatio);
2159 $YBottom = $this->GArea_Y2 - (($LastValue [$Key] - $this->VMin) * $this->DivisionRatio);
2162 $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio);
2168 if ($this->BuildMap)
2169 …$this->addToImageMap ( $XPos + 1, min ( $YBottom, $YPos ), $XPos + $SeriesWidth - 1, max ( $YBotto…
2171 $this->canvas->drawFilledRectangle(new Point($XPos + 1,
2175 $this->palette->colors[$ColorID],
2176 $this->shadowProperties,
2181 $XPos = $XPos + $this->DivisionWidth;
2196 $this->validateDataDescription ( "drawLimitsGraph", $DataDescription );
2197 $this->validateData ( "drawLimitsGraph", $Data );
2199 $XWidth = $this->DivisionWidth / 4;
2200 $XPos = $this->GArea_X1 + $this->GAreaXOffset;
2202 $graphAreaMin = new Point($this->GArea_X1, $this->GArea_Y1);
2203 $graphAreaMax = new Point($this->GArea_X2, $this->GArea_Y2);
2227 $YPos = $this->GArea_Y2 - (($Max - $this->VMin) * $this->DivisionRatio);
2231 if ($X1 <= $this->GArea_X1) {
2232 $X1 = $this->GArea_X1 + 1;
2234 if ($X2 >= $this->GArea_X2) {
2235 $X2 = $this->GArea_X2 - 1;
2238 $YPos = $this->GArea_Y2 - (($Min - $this->VMin) * $this->DivisionRatio);
2241 $this->canvas->drawLine(new Point(floor ( $XPos ) - .2, $Y1 + 1),
2244 $this->LineWidth,
2245 $this->LineDotSize,
2246 $this->shadowProperties,
2249 $this->canvas->drawLine(new Point(floor ( $XPos ) + .2, $Y1 + 1),
2252 $this->LineWidth,
2253 $this->LineDotSize,
2254 $this->shadowProperties,
2257 $this->canvas->drawLine(new Point($X1,
2261 $this->palette->colors[$MaxID],
2262 $this->LineWidth,
2263 $this->LineDotSize,
2264 $this->shadowProperties);
2265 $this->canvas->drawLine(new Point($X1,
2269 $this->palette->colors[$MinID],
2270 $this->LineWidth,
2271 $this->LineDotSize,
2272 $this->shadowProperties);
2274 $XPos = $XPos + $this->DivisionWidth;
2291 $this->validateDataDescription ( "drawRadarAxis", $DataDescription );
2292 $this->validateData ( "drawRadarAxis", $Data );
2296 $Radius = ($this->GArea_Y2 - $this->GArea_Y1) / 2 - $BorderOffset;
2297 $XCenter = ($this->GArea_X2 - $this->GArea_X1) / 2 + $this->GArea_X1;
2298 $YCenter = ($this->GArea_Y2 - $this->GArea_Y1) / 2 + $this->GArea_Y1;
2337 $this->canvas->drawFilledPolygon($Plots,
2361 $this->canvas->drawDottedLine(new Point($LastX, $LastY),
2364 $this->shadowProperties);
2377 $this->canvas->drawLine(new Point($XCenter, $YCenter),
2380 $this->LineWidth,
2381 $this->LineDotSize,
2382 $this->shadowProperties);
2389 $Positions = imagettfbbox ( $this->FontSize, 0, $this->FontName, $Label );
2405 $this->canvas->drawText($this->FontSize,
2409 $this->FontName,
2428 $Positions = imagettfbbox ( $this->FontSize, 0, $this->FontName, $t );
2430 $Y = $YPos + $this->FontSize;
2432 $this->canvas->drawFilledRoundedRectangle(new Point($X + $Positions [6] - 2,
2438 $this->LineWidth,
2439 $this->LineDotSize,
2440 $this->shadowProperties);
2442 $this->canvas->drawRoundedRectangle(new Point($X + $Positions [6] - 2,
2448 $this->LineWidth,
2449 $this->LineDotSize,
2450 $this->shadowProperties);
2451 $this->canvas->drawText($this->FontSize,
2455 $this->FontName,
2479 $this->validateDataDescription ( "drawRadar", $DataDescription );
2480 $this->validateData ( "drawRadar", $Data );
2483 $Radius = ($this->GArea_Y2 - $this->GArea_Y1) / 2 - $BorderOffset;
2484 $XCenter = ($this->GArea_X2 - $this->GArea_X1) / 2 + $this->GArea_X1;
2485 $YCenter = ($this->GArea_Y2 - $this->GArea_Y1) / 2 + $this->GArea_Y1;
2489 $MaxValue = $this->calculateMaxValue($Data, $DataDescription);
2507 $this->canvas->drawLine(new Point($XLast,
2511 $this->palette->colors[$ColorID],
2512 $this->LineWidth,
2513 $this->LineDotSize,
2514 $this->shadowProperties);
2526 $this->canvas->drawLine(new Point($XPos,
2530 $this->palette->colors[$ColorID],
2531 $this->LineWidth,
2532 $this->LineDotSize,
2533 $this->shadowProperties);
2543 $this->validateDataDescription ( "drawFilledRadar", $DataDescription );
2544 $this->validateData ( "drawFilledRadar", $Data );
2547 $Radius = ($this->GArea_Y2 - $this->GArea_Y1) / 2 - $BorderOffset;
2548 $XCenter = ($this->GArea_X2 - $this->GArea_X1) / 2;
2549 $YCenter = ($this->GArea_Y2 - $this->GArea_Y1) / 2;
2553 $MaxValue = $this->calculateMaxValue($Data, $DataDescription);
2574 $Plots [] = $XPos + $this->GArea_X1;
2575 $Plots [] = $YPos + $this->GArea_Y1;
2586 $this->canvas->drawFilledPolygon($Plots,
2588 $this->palette->colors[$ColorID],
2592 $this->canvas->drawLine(new Point($Plots [$i],
2596 $this->palette->colors[$ColorID],
2597 $this->LineWidth,
2598 $this->LineDotSize,
2599 $this->shadowProperties);
2610 $C_Background = $this->canvas->allocateColor($color);
2611 …imagefilledrectangle ( $this->canvas->getPicture(), 0, 0, $this->XSize, $this->YSize, $C_Backgroun…
2626 $this->canvas->drawFilledRectangle(new Point($point1->getX(), $Yi1),
2641 $this->canvas->drawFilledRectangle(new Point($point1->getX(), $Yi1),
2663 $this->drawGradient(new Point($this->GArea_X1 + 1, $this->GArea_Y1 + 1),
2664 new Point($this->GArea_X2 - 1, $this->GArea_Y2),
2670 $this->drawGradient(new Point(0, 0),
2671 new Point($this->XSize, $this->YSize),
2680 $this->canvas->drawCircle(new Point($Xc, $Yc), $Height, $color, $this->shadowProperties, $Width );
2687 …$this->canvas->drawFilledCircle(new Point($Xc, $Yc), $Height, $color, $this->shadowProperties, $Wi…
2694 $this->drawFromPicture ( 1, $FileName, $X, $Y, $Alpha );
2701 $this->drawFromPicture ( 2, $FileName, $X, $Y, $Alpha );
2708 $this->drawFromPicture ( 3, $FileName, $X, $Y, $Alpha );
2729 imagecopymerge ( $this->canvas->getPicture(), $Raster, $X, $Y, 0, 0, $Width, $Height, $Alpha );
2740 $Width = $this->XSize + 2 * $Size;
2741 $Height = $this->YSize + 2 * $Size;
2747 …imagecopy ( $Resampled, $this->canvas->getPicture(), $Size, $Size, 0, 0, $this->XSize, $this->YSiz…
2748 imagedestroy ( $this->canvas->getPicture() );
2750 $this->XSize = $Width;
2751 $this->YSize = $Height;
2753 $this->canvas->setPicture(imagecreatetruecolor ( $this->XSize, $this->YSize ));
2754 $C_White = $this->canvas->allocate(new Color(255, 255, 255));
2755 imagefilledrectangle ( $this->canvas->getPicture(), 0, 0, $this->XSize, $this->YSize, $C_White );
2756 imagecolortransparent ( $this->canvas->getPicture(), $C_White );
2757 imagecopy ( $this->canvas->getPicture(), $Resampled, 0, 0, 0, 0, $this->XSize, $this->YSize );
2764 if ($this->ErrorReporting)
2765 $this->printErrors ( $this->ErrorInterface );
2768 if ($this->BuildMap)
2769 $this->SaveImageMap ();
2771 imagepng ( $this->canvas->getPicture(), $FileName );
2778 if ($this->ErrorReporting)
2779 $this->printErrors ( "GD" );
2782 if ($this->BuildMap)
2783 $this->SaveImageMap ();
2786 imagepng ( $this->canvas->getPicture() );
2796 $this->Errors [] = "[Warning] " . $FunctionName . " - Y Labels are not set.";
2802 $this->Errors [] = "[Warning] " . $FunctionName . " - Series descriptions are not set.";
2809 $this->Errors [] = "[Warning] " . $FunctionName . " - Some series descriptions are not set.";
2834 $this->Errors [] = "[Warning] " . $FunctionName . " - No data set.";
2838 $this->Errors [] = "[Warning] " . $FunctionName . " - Missing data in serie " . $key . ".";
2847 if (count ( $this->Errors ) == 0)
2851 foreach ( $this->Errors as $key => $Value )
2855 foreach ( $this->Errors as $key => $Value ) {
2856 $Position = imageftbbox ( $this->ErrorFontSize, 0, $this->ErrorFontName, $Value );
2862 $this->canvas->drawFilledRoundedRectangle(new Point($this->XSize - ($MaxWidth + 20),
2863 $this->YSize - (20 + (($this->ErrorFontSize + 4) * count ( $this->Errors )))),
2864 new Point($this->XSize - 10,
2865 $this->YSize - 10),
2868 $this->lineWidth,
2869 $this->lineDotSize,
2870 $this->shadowProperties);
2872 $this->canvas->drawRoundedRectangle(new Point($this->XSize - ($MaxWidth + 20),
2873 $this->YSize - (20 + (($this->ErrorFontSize + 4) * count ( $this->Errors )))),
2874 new Point($this->XSize - 10,
2875 $this->YSize - 10),
2878 $this->LineWidth,
2879 $this->LineDotSize,
2880 $this->shadowProperties);
2882 $YPos = $this->YSize - (18 + (count ( $this->Errors ) - 1) * ($this->ErrorFontSize + 4));
2883 foreach ( $this->Errors as $key => $Value ) {
2884 $this->canvas->drawText($this->ErrorFontSize,
2886 new Point($this->XSize - ($MaxWidth + 15),
2889 $this->ErrorFontName,
2892 $YPos = $YPos + ($this->ErrorFontSize + 4);
2901 $this->BuildMap = $Mode;
2902 $this->MapID = $GraphID;
2909 if ($this->MapFunction == NULL || $this->MapFunction == $CallerFunction) {
2910 …$this->ImageMap [] = round ( $X1 ) . "," . round ( $Y1 ) . "," . round ( $X2 ) . "," . round ( $Y2…
2911 $this->MapFunction = $CallerFunction;
2920 $Values = $this->tmpFolder . $MapName;
2944 if (! $this->BuildMap) {
2948 if ($this->ImageMap == NULL) {
2949 $this->Errors [] = "[Warning] SaveImageMap - Image map is empty.";
2953 $Handle = fopen ( $this->tmpFolder . $this->MapID, 'w' );
2955 $this->Errors [] = "[Warning] SaveImageMap - Cannot save the image map.";
2958 foreach ( $this->ImageMap as $Value )
2968 $this->DateFormat = $Format;
2975 return (date ( $this->DateFormat, $Value ));
2995 $MaxDivs = ($this->GArea_Y2 - $this->GArea_Y1) / $MinDivHeight;
2997 if ($this->VMax <= $this->VMin) {
3001 if ($this->VMin == 0 && $this->VMax == 0) {
3002 $this->VMin = 0;
3003 $this->VMax = 2;
3008 $Scale1 = ($this->VMax - $this->VMin) / $Factor;
3009 $Scale2 = ($this->VMax - $this->VMin) / $Factor / 2;
3031 if (floor ( $this->VMax / $Scale / $Factor ) != $this->VMax / $Scale / $Factor) {
3032 $GridID = floor ( $this->VMax / $Scale / $Factor ) + 1;
3033 $this->VMax = $GridID * $Scale * $Factor;
3037 if (floor ( $this->VMin / $Scale / $Factor ) != $this->VMin / $Scale / $Factor) {
3038 $GridID = floor ( $this->VMin / $Scale / $Factor );
3039 $this->VMin = $GridID * $Scale * $Factor;
3050 return $this->canvas->getPicture();
3124 return $this->ToDate ( $value );