Hello,
I hope you can help me. The Jpgraph forum seems to be pretty
uneventful with participation.
I am trying to pass arrays through the image tag to populate my
variables for my graph.
I keep getting an error that there is no input. Do you have any suggestions=
?
I would greatly appreciate it! I have been trying to figure this out
for several hours.
Below is my code:
I need some help with finding a solution. For some reason my graph is
not showing up when it evident that my arrays are being passed.
When I use:
echo "TEST DATA PRINT";
print_r($datay,false);
-------------------
I keep getting the error:
Empty input data array specified for plot.
-----------------------
My php script is as follows:
-----------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml">
<head>
<title>KCRF Dashboard</title>
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$term=3D$_POST['term'];
$term2=3D$_POST['term2'];
$term3=3D$_POST['term3'];
//include ('err_reporting.php');
require ('PHP_Scripts/config.php');
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');
=A0=A0 $sql =3D ("SELECT * FROM evdobanding WHERE Market like '%$term' and
Cell_Sect =3D '$term2' and Date =3D '$term3' ORDER BY distance asc");
=A0=A0 $result =3D mysql_query($sql);
=A0=A0 while($row =3D mysql_fetch_array($result))
=A0=A0 {
=A0=A0 $datay[] =3D $row["MBusage"];
=A0=A0 $datax[] =3D $row["Distance"];
=A0=A0 }
=A0 echo "TEST DATA PRINT";
=A0 print_r($datay,false);
?>
<style type=3D"text/css">
<!--
=A0#navbar ul {
=A0=A0=A0=A0=A0=A0=A0 margin: 0;
=A0=A0=A0=A0=A0=A0=A0 padding: 5px;
=A0=A0=A0=A0=A0=A0=A0 list-style-type: none;
=A0=A0=A0=A0=A0=A0=A0 text-align: center;
=A0=A0=A0=A0 =A0=A0=A0background-color: #000;
=A0=A0=A0=A0=A0=A0=A0 }
#navbar ul li {
=A0=A0=A0=A0=A0=A0=A0 display: inline;
=A0=A0=A0=A0=A0=A0=A0 }
#navbar ul li a {
=A0=A0=A0=A0=A0=A0=A0 text-decoration: none;
=A0=A0=A0=A0=A0=A0=A0 padding: .2em 1em;
=A0=A0=A0=A0=A0=A0=A0 color: #fff;
=A0=A0=A0=A0=A0=A0=A0 background-color: #000;
=A0=A0=A0=A0=A0=A0=A0 }
#navbar ul li a:hover {
=A0=A0=A0=A0=A0=A0=A0 color: #000;
=A0=A0=A0=A0=A0=A0=A0 background-color: #fff;
=A0=A0=A0=A0=A0=A0=A0 }
-->
</style>
</head>
<fieldset style=3D"border: 1px ridge limegreen; color: limegreen;">
<legend style=3D"color: #000; font-family: verdana; font-size:
14pt;">EVDO PCMD BANDING</legend> <body> <div id=3D"navbar">
=A0 <ul>
=A0=A0=A0=A0=A0=A0=A0 <li><a href=3D"index.php">Home</a></li>
=A0=A0=A0=A0=A0=A0=A0 <li><a href=3D"dd3.php">EVDO PCMD KPI</a></li>
=A0=A0=A0=A0=A0=A0=A0 <li><a href=3D"banding.php">EVDO Distance Banding</a>=
</li>
=A0=A0=A0=A0=A0=A0=A0 <li><a href=3D"test.php">TEST_BANDING</a></li>
=A0=A0=A0=A0=A0=A0=A0 <li><a href=3D"">LinkHere</a></li>
=A0 </ul>
</div>
</fieldset>
<?php
echo "You Selected the following:<br>Market =3D $term <br>Cell_Sector =3D
$term2<br>Timestamp =3D $term3<br>"; ?>
<img src=3D"bandingGraph.php?$datax=3D$row["Distance"]&$datay=3D$row["MBusa=
ge"];">
// I think this is where I am having issues.
</body>
</html>
---------------------------
My graph script is:
<?php // content=3D"text/plain; charset=3Dutf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');
=A0=A0 // Create the graph.
=A0=A0 $graph =3D new Graph(1024,450,"auto");
=A0=A0 $graph->SetScale("textlin");
=A0=A0 $graph->SetShadow();
=A0=A0 // Slightly adjust the legend from it's default position
=A0 =A0$graph->legend->Pos(0.03,0.5,"right","center");
=A0=A0 $graph->legend->SetFont(FF_FONT1,FS_BOLD);
=A0=A0 //Setup X-scale
=A0=A0=A0=A0 $graph->xaxis->SetTextTickInterval(10);
=A0=A0=A0=A0 $graph->xaxis->SetTickLabels($datax);
=A0=A0=A0=A0 //$graph->xtick_factor =3D 1;
=A0=A0=A0 $graph->xaxis->SetLabelAngle(30);
=A0=A0 // Create the linear plot
=A0=A0 $lineplot=3D new LinePlot($datay);
=A0=A0 $p1 =3D new LinePlot($datay);
=A0=A0 $p1->mark->SetType(MARK_DIAMOND);
=A0=A0 $p1->mark->SetFillColor("blue");
=A0=A0 $p1->mark->SetWidth(;
=A0=A0 $p1->SetColor("blue");
=A0=A0 $p1->SetCenter();
=A0=A0 $p1->SetLegend("EVDO F1 Carrier");
=A0=A0 $graph->Add($p1);
=A0=A0 // Add the plot to the graph
=A0=A0 $graph->Add($lineplot);
=A0=A0 // Setup margin and titles
=A0=A0 $graph->img->SetMargin(40,40,50,60);
=A0=A0 $graph->title->SetMargin(10);
=A0=A0 $graph->title->Set("Distance in MIles");
=A0=A0 $graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
=A0=A0 // set margin color
=A0=A0 $graph->SetMarginColor('#dcfade');
=A0=A0 // Use built in font
=A0=A0 $graph->title->SetFont(FF_ARIAL,FS_NORMAL,14);
=A0=A0 $graph->ygrid->SetFill(true,'#EFEFEF [at] 0.6','#e5e5e5 [at] 0.6');
=A0=A0 $graph->xgrid->Show();
=A0=A0 $graph->SetBackgroundImageMix(15);
=A0=A0 $graph->legend->Pos(0.02,0.03,"right","top");
=A0=A0 $graph->legend->SetFont(FF_FONT1,FS_BOLD);
=A0=A0 $graph->xaxis->title->Set("Miles");
=A0=A0 $graph->yaxis->title->Set("MBusage");
=A0=A0 $graph->SetAlphaBlending();
=A0=A0 // Display the graph
=A0=A0 $graph->Stroke();
?>
Thank you,
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
