$this->render_dots(); $this->render_point_labels(); } break; case "pie": $this->render_pie(); break; default: $this->create_error_graphic("unknown graph type: " . $this->options["type"]); break; } if ($this->options["debug"]) { $this->log("would have output png now."); } else { imagepng($this->img); } imagedestroy($this->img); } } $scriptname = basename($_SERVER["PHP_SELF"]); switch ($scriptname) { case "eqn_multigraph.php": // called to render inline $foo = new Eqn_multigraph(); $foo->parseurl(); $foo->render(); if ($foo->options["debug"]) { $foo->dump_errors(); } break; }
for ($i = -5; $i < 10; $i++) { $s45[$i] = $i; } // 60 degree line for ($i = -5; $i < 10; $i++) { $s60[$i] = 2 * $i; } $g->add_series($s45, "Y = X"); $g->add_series($s60, "Y = 2X"); print("<a href=\"".$g->createurl()."&debug=1\"><img src=\"" .$g->createurl()."\" title=\"click to see debug output\"></a><br>"); } $eqn = "y = x^2;"; $g = new Eqn_multigraph(array( "title" => "testing equation graph", "width" => $gwidth, "height" => $gheight, "type" => "line", "square" => 1, "x_start" => -5, "x_end" => 5, "eqn" => "y = x^2", )); print("<a href=\"".$g->createurl()."&debug=1\"><img src=\"" .$g->createurl()."\" title=\"click to see debug output\"></a><br>"); ?> </body> </html>