Triby gracias por responder , pero donde pueden estar esas etiquetas
te voy a mostrar como esta construido el ejemplo
Código PHP:
Ver originalinclude('inc/jpgraph.php');
include('inc/jpgraph_line.php');
include('inc/jpgraph_date.php');
include('inc/jpgraph_utils.inc.php');
// Get a dataset stored in $xdata and $ydata
include('inc/dataset01.inc.php');
$dateUtils = new DateScaleUtils();
// Setup a basic graph
$width=700; $height=400;
$graph = new Graph($width, $height);
$graph->SetScale('datlin');
$graph->SetMargin(60,20,40,60);
// Setup the titles
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->title->Set('Development since 1984');
$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10);
$graph->subtitle->Set('(Example using the builtin date scale)');
// Setup the labels to be correctly format on the X-axis
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
$graph->xaxis->SetLabelAngle(30);
$lp1 = new LinePlot($ydata,$xdata);
$lp1->SetWeight(0);
$graph->Add($lp1);
// And then add line. We use two plots in order to get a
// more distinct border on the graph
$lp2 = new LinePlot($ydata,$xdata);
$lp2->SetColor('orange');
$graph->Add($lp2);
// And send back to the client
$graph->Stroke();
include('inc/dataset01.inc.php')
en dataset01.inc.php estan los datos almacenados
Código PHP:
Ver original 0 => 1.0885908919277, 1 =>
0.99034385297982, 2 => 0.97005467188578, 3 =>
0.99901201350824, 4 => 1.1263167971152, 5 =>
1.0582808133448, 6 => 1.0216740689064, 7 =>
0.96626236356644, 8 => 1.0125912828768, 9 =>
0 => 444348000, 1 => 446853600, 2 =>
449532000, 3 => 452124000, 4 => 454802400, 5 =>
457394400, 6 => 460072800, 7 => 462751200, 8 =>
lo unico que yo estoy cambiando es de donde consigo los datos
a continuacion mi codigo
Código PHP:
Ver originalinclude('inc/jpgraph.php');
include('inc/jpgraph_line.php');
include('inc/jpgraph_date.php');
include('inc/jpgraph_utils.inc.php');
$dateUtils = new DateScaleUtils();
$width=700; $height=400;
$graph = new Graph($width, $height);
$graph->SetScale('datlin');
$graph->SetMargin(60,20,40,60);
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->title->Set('Development since 1984');
$graph->subtitle->SetFont(FF_ARIAL,FS_ITALIC,10);
$graph->subtitle->Set('(Example using the builtin date scale)');
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
$graph->xaxis->SetLabelAngle(30);
$servidor = 'localhost';
$bd = 'tremor';
$usuario = 'postgres';
$contrasenia = 'hoe798cs';
$tabla = 'tremor';
global $servidor, $bd, $usuario, $contrasenia;
$db = new PDO('pgsql:host=' . $servidor . ';dbname=' . $bd, $usuario, $contrasenia);
$consulta = $db->prepare("SELECT campo10, campo1, EXTRACT(epoch FROM campo1)AS fechas1 FROM tremor;");
$consulta->execute();
while($fila = $consulta->fetch(PDO::FETCH_ASSOC))
{
$ydata[] = $fila['campo10'];
$xdata[] = $fila['fechas1'];
}
$lp1 = new LinePlot($ydata,$xdata);
$lp1->SetWeight(0);
$graph->Add($lp1);
$lp2 = new LinePlot($ydata,$xdata);
$lp2->SetColor('orange');
$graph->Add($lp2);
$graph->Stroke();
que estoy haciendo mal?