KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/irtiweb/CATS/lib/artichow/patterns/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/irtiweb/CATS/lib/artichow/patterns/BarDepth.php
<?php
/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */

require_once ARTICHOW."/BarPlot.class.php";

class BarDepthPattern extends Pattern {

	protected function getPlot($y, $depth) {

		$plot = new BarPlot($y, 1, 1, $depth);

		$plot->barShadow->setSize(2);
		$plot->barShadow->smooth(TRUE);
		$plot->barShadow->setColor(new Color(160, 160, 160, 10));

		return $plot;

	}

	public function create() {

		$group = new PlotGroup;
		$group->setSpace(2, 2, 2, 0);
		$group->setPadding(30, 10, NULL, NULL);

		$group->grid->hideVertical(TRUE);
		$group->grid->setType(Line::DASHED);

		$yForeground = $this->getArg('yForeground');
		$yBackground = $this->getArg('yBackground');

		$legendForeground = $this->getArg('legendForeground');
		$legendBackground = $this->getArg('legendBackground');

		$colorForeground = $this->getArg('colorForeground', new LightBlue(10));
		$colorBackground = $this->getArg('colorBackground', new Orange(25));

		if($yForeground === NULL) {
			trigger_error("Argument 'yForeground' must not be NULL", E_USER_ERROR);
		}

		// Background
		if($yBackground !== NULL) {

			$plot = $this->getPlot($yBackground, 6);
			$plot->setBarColor($colorBackground);

			$group->add($plot);
			if($legendBackground !== NULL) {
				$group->legend->add($plot, $legendBackground, Legend::BACKGROUND);
			}

		}

		// Foreground
		$plot = $this->getPlot($yForeground, 0);
		$plot->setBarColor($colorForeground);

		$group->add($plot);
		if($legendForeground !== NULL) {
			$group->legend->add($plot, $legendForeground, Legend::BACKGROUND);
		}

		$group->axis->bottom->hideTicks(TRUE);

		$group->legend->shadow->setSize(0);
		$group->legend->setAlign(Legend::CENTER);
		$group->legend->setSpace(6);
		$group->legend->setTextFont(new Tuffy(8));
		$group->legend->setPosition(0.50, 0.10);
		$group->legend->setBackgroundColor(new Color(255, 255, 255, 10));
		$group->legend->setColumns(2);

		return $group;

	}

}
?>

Anon7 - 2021