Ich benutze momentan jpgraph zum erstellen von mehreren diagrammen, da ich aber das script komplett umkrempeln will und mir die Ladezeiten auch zu hoch sind suche ich nach einer Alternative dazu. Momentan schaut das ganze so aus.
http://91.121.142.37/gawebe/marktpreise/
Scriptausschnitt für ein Diagram
aufruf erfolgt ganz einfach über
nur will ich jetzt 1. schnellere Ladezeiten erzielen und 2. ohne Iframes Arbeiten
Danke im voraus für Tips
http://91.121.142.37/gawebe/marktpreise/
Scriptausschnitt für ein Diagram
PHP:
<?php
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');
$region[0] = "Jita";
$region[1] = "Yarebap";
$region[2] = "Amarr";
$region[3] = "Hek";
$region[4] = "Rens";
$region[5] = "Dodixie";
for ($i = 0; $i < count ($region); $i++)
{
$sql = "
SELECT
*
FROM
mineraliean
WHERE
Ort = '".$region[$i]."'
ORDER BY
Time
DESC
LIMIT 0,7
";
$result = mysql_query($sql) or die(mysql_error());
$y = 0;
while($dat=mysql_fetch_array($result))
{
$data[$i][$y] = $dat[$mineral];
$y++;
}
}
$datay1 = $data[0];
$datay2 = $data[1];
$datay3 = $data[2];
$datay4 = $data[3];
$datay5 = $data[4];
$datay6 = $data[5];
$totalcount = 7;
for($i = count($datay1); $i < $totalcount; $i++){
$datay1[] = 0;
}
for($i = count($datay2); $i < $totalcount; $i++){
$datay2[] = 0;
}
for($i = count($datay3); $i < $totalcount; $i++){
$datay3[] = 0;
}
for($i = count($datay4); $i < $totalcount; $i++){
$datay4[] = 0;
}
for($i = count($datay5); $i < $totalcount; $i++){
$datay5[] = 0;
}
for($i = count($datay6); $i < $totalcount; $i++){
$datay6[] = 0;
}
// Setup the graph
$graph = new Graph(600,300);
$graph->SetScale("textlin");
$theme_class=new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->img->SetAntiAliasing(false);
$graph->title->Set('Preisverlauf '.$mineral.' 7 Tage');
$graph->SetBox(false);
$graph->img->SetAntiAliasing();
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xgrid->Show();
$graph->xgrid->SetLineStyle("solid");
$graph->xaxis->SetTickLabels(array('Heute','gestern','3 Tage','4 Tage','5 Tage','6 Tage','7 Tage'));
$graph->xgrid->SetColor('#E3E3E3');
// Create the first line
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#0000ff");
$p1->SetLegend('Jita');
// Create the second line
$p2 = new LinePlot($datay2);
$graph->Add($p2);
$p2->SetColor("#00ff00");
$p2->SetLegend('Yarebap');
// Create the third line
$p3 = new LinePlot($datay3);
$graph->Add($p3);
$p3->SetColor("#ff0000");
$p3->SetLegend('Amarr');
// Create the 4
$p4 = new LinePlot($datay4);
$graph->Add($p4);
$p4->SetColor("#ff8c00");
$p4->SetLegend('Hek');
// Create the 5
$p5 = new LinePlot($datay5);
$graph->Add($p5);
$p5->SetColor("#9932CC");
$p5->SetLegend('Rens');
// Create the 6
$p6 = new LinePlot($datay6);
$graph->Add($p6);
$p6->SetColor("#7FFFD4");
$p6->SetLegend('Dodixie');
$graph->legend->SetFrameWeight(1);
// Output line
$graph->Stroke();
?>
aufruf erfolgt ganz einfach über
PHP:
<?php echo $mineral;?>
nur will ich jetzt 1. schnellere Ladezeiten erzielen und 2. ohne Iframes Arbeiten
Danke im voraus für Tips