<?php include ("jpgraph-1.5.3/src/jpgraph.php"); include ("jpgraph-1.5.3/src/jpgraph_bar.php"); include ("jpgraph-1.5.3/src/jpgraph_line.php"); $datay = array();for ($i= 0; $i
<10; $i++) { array_push($datay, rand(0,200)/100); }$datay2=array(); for ($i= 0; $i
<10; $i++) { array_push($datay2, rand(0,100)/100); }$datax = array(); $targets = array(); $alts = array(); $graph = new Graph(400,100,0); $graph-
>SetScale("textlin"); $bplot = new LinePlot($datay); $graph->Add($bplot); $bplot2 = new BarPlot($datay2); $graph->Add($bplot2); $graph->img->SetAntiAliasing(); $graph->Stroke("tmp.png"); echo "<img src='tmp.png'>"; ?>
|
Diagramm, das einen Array mit JPGraph-Mitteln als BarChart darstellt (Abb. 3). |
Dieser Text ist der Zeitschriften-Ausgabe 05/2002 von iX entnommen.
iOS, Android, Windows Phone 7 und HTML5 - das neue Sonderheft von heise Developer führt Einsteiger und Profis in die Programmierung mobiler Geräte ein.