function Graph($aWidth = 300, $aHeight = 200, $aCachedName = "", $a = 0) { if (BRAND_TIMING) { global $tim; $tim = new Timer(); $tim->Push(); } $this->img = new RotImage($aWidth, $aHeight, $a); $this->cache = new ImgStreamCache($this->img); $this->title = new Text(""); $this->legend = new Legend(); if ($aCachedName != "" && READ_CACHE) { if ($this->cache->GetAndStream($aCachedName)) { exit; } } $this->cache_name = $aCachedName; $this->SetTickDensity(); // Normal density }
$i = 1; foreach ($allfiles as $f) { $buf .= "<h4>Theme {$i} (<i>" . $names[$i - 1] . ")</i></h4>\n"; $buf .= sprintf($frm, basename($f)); ++$i; } $fp = fopen(CACHE_DIR . "themes.html", "w"); if (!$fp) { die("Can't create index file."); } fwrite($fp, $buf); fclose($fp); echo "<br>"; } $th = array("earth" => array(22, 424, 10, 34, 40, 45, 49, 62, 63, 74, 77, 119, 120, 134, 136, 141, 168, 180, 209, 218, 346, 395, 89, 430), "pastel" => array(22, 424, 27, 38, 42, 58, 66, 79, 105, 110, 128, 147, 152, 230, 240, 331, 337, 405, 415), "water" => array(22, 424, 8, 10, 14, 24, 56, 213, 237, 268, 326, 335, 370, 387, 388), "sand" => array(22, 424, 19, 34, 50, 65, 72, 82, 131, 168, 209)); echo "<h2>JpGraph color chart</h2>"; echo "Generating color chart images ...<br>\n"; flush(); $timer = new Timer(); $timer->Push(); GenColIndex(); echo "<p>Generating themes..."; GenThemes($th); $t = $timer->Pop() / 1000; $t = sprintf("<p>Work done in: %0.2f seconds.", round($t, 2)); echo "{$t}<p>See <a href=\"" . CACHE_DIR . "colorchart.html\">Colorchart</a>\n"; echo "<br>See <a href=\"" . CACHE_DIR . "themes.html\">Index of themes</a>\n"; ?>