Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ('config.php');
- mysql_select_db ($dbc, $login);
- /////////////////////////////////////////////////////////////////////////////////////
- /* !!!!!! */
- $data = mysql_query("select count(*) from `graf_bayer` where `realmid`='1'")or die("Nelze se připojit k MySQL: " . mysql_error());
- $stop=mysql_result($data,0);
- mysql_free_result($data);
- $start=$stop-1500;
- if ($start < 0)
- $start = 0;
- /* !!!!!! */
- $data = mysql_query("select `ali`,`horda`,TIME(`date`) as `cas` from `graf_bayer` where `realmid`='1' limit $start,$stop")or die("Nelze se připojit k MySQL: " . mysql_error());
- /* !!!!!! */
- $i=0;
- while($row=mysql_fetch_array($data))
- {
- $ali[$i]=$row['ali'];
- $horda[$i]=$row['horda'];
- $celkem[$i]=$row['ali'] + $row['horda'];
- //if ($i%360 == 0) // viz tick interval, mensi vyuziti pameti (funguje s i bez)
- $timestamps[$i]=$row['cas'];
- $i++;
- }
- /////////////////////////////////////////////////////////////////////////////////////
- require_once ('jpgraph/jpgraph.php');
- require_once ('jpgraph/jpgraph_line.php');
- $datay1 = array(3,4,5);
- $datay2 = array(4,5,6);
- $datay3 = array(7,8,9);
- $datay4 = array(0,0);
- // Setup the graph
- $graph = new Graph(800,500);
- $graph->SetScale("textlin");
- $theme_class=new SoftyTheme;
- $graph->SetTheme($theme_class);
- $graph->img->SetAntiAliasing(false);
- $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($timestamps);
- $graph->xgrid->SetColor('black');
- //////////////////////////////////////////////////////////////////////////
- /* !!!!!! */
- $p1 = new LinePlot($ali);
- $graph->Add($p1);
- $p1->SetColor("blue");
- $p1->SetLegend('Alliance');
- /* !!!!!! */
- $p2 = new LinePlot($horda);
- $graph->Add($p2);
- $p2->SetColor("red");
- $p2->SetLegend('Horde');
- /* !!!!!! */
- $p3 = new LinePlot($celkem);
- $graph->Add($p3);
- $p3->SetColor("green");
- $p3->SetLegend('Celkem');
- $p4 = new LinePlot($datay4);
- $graph->Add($p4);
- $p4->SetColor("black");
- $graph->legend->SetFrameWeight(4);
- // Output line
- $graph->Stroke();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement