<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example22"); $chart->plot($data4, false, "blue"); $chart->add_legend("Gross", "blue"); $chart->plot($data); $chart->add_legend("Net"); $chart->stroke(); ?>
} $last = $point; } list($future_xs, $future_ys) = separate_xy($future); list($current_xs, $current_ys) = separate_xy($current); if ($last[1] >= 0.0) { $overunder = 0; $color = "green"; $endtype = "acceptance"; } else { $overunder = 2; $color = "red"; $endtype = "rejection"; } $future_color = shade($color, "white", 0.2); $chart->add_legend($color . " = current area", $color); $chart->add_legend("light " . $color . " = estimated area for " . $endtype, $future_color); /*echo strftime("%Y-%m-%d %H:%M:%S", $x) . "<br>"; */ $chart->plot($future_ys, $future_xs, $future_color, "gradient", $future_color, 0 + $overunder); $chart->plot($current_ys, $current_xs, $color, "gradient", $color, 0 + $overunder); $chart->plot(array(0, 0), array($current_xs[0], $end + 1), "white", "gradient", "white", 0 + $overunder); // The actual curve $xs = array(); $ys = array(); foreach ($graph as $point) { $xs[] = $point[0]; $ys[] = $point[1]; } $chart->plot($ys, $xs); // The zero-line $chart->plot(array(0, 0), array($start, $end), "blue");
$width = 300; $height = 100; } if ($_GET[tam] == "mini") { $width = 200; $height = 100; } // Creamos el tamaño de la imagen //$chart = new chart($width, $height); $hora = date("i"); $nombrecache = "ticker-" . $_GET["ticker"] . "-" . $_GET["tam"] . "-" . $_GET["dias"] . "-" . $hora; $chart = new chart($width, $height, $nombrecache . ".png"); // Elegimos que media móvil dibujar if ($_GET[mm3]) { $chart->plot($mm3, false, "red"); $chart->add_legend("MM3", "red"); } if ($_GET[mm10]) { $chart->plot($mm10, false, "green"); $chart->add_legend("MM10", "green"); } //Dibujamos el cierre if ($_GET[cierre]) { $chart->plot($cierre, false, "black", "cross", false, 4); } //Dibujamos apertura if ($_GET[apertura]) { $chart->plot($apertura, false, "gray", "box", "black"); } // Dibujamos el valor de color azul $chart->plot($valor, false, "blue");
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example31"); $chart->set_font("/usr/share/texmf/fonts/type1/adobe/utopia/putb8a.pfb", "type1", 11); $chart->set_title("A Package For Generating Charts"); $chart->plot($data4, false, "red", "gradient", "white", 0); $chart->plot($data, false, "blue", "gradient", "white", 4); $chart->plot($data4, false, "gray"); $chart->plot($data4, false, "gray", "box", "black"); $chart->add_legend("Other Things", "red"); $chart->add_legend("More Stuff", "blue"); $chart->stroke(); ?>