Jump to content
JoaoVM

Dados MySql + PHPGraphLib

Recommended Posts

JoaoVM

Boa Tarde,

Tenho uma base de dados MySql na qual preciso de sacar os dados de pontos e colocar num gráfico de pontos do PHPGraphLib, se alguém souber como me ajudar... isto é o que tenho..preciso de sacar os dados em vez de os colocar..

<?php
$url='pontos.php';
header("Refresh: 5; URL=$url");

require_once('phpgraphlib.php');
//require_once('init.php');
$sql="SELECT pontos_x, from para_testar";
$resultado = mysql_query($sql);
$nreg = mysql_num_rows($resultado);
$graph = new PHPGraphLib(1270,500);
$data = array(
"1" => .0032,
"2" => .0028,
"3" => .0021,
"4" => .0033,
"5" => .0034,
"6" => .0044,
"7" => .0036,
"8" => .0027,
"9" => .0025,
"10" => .0021,
"11" => .0026,
"12" => .0024,
"13" => .0036,
"14" => .0028,
"15" => .0025,
"16" => .0021,
"17" => .0029,
"18" => .0028,
"19" => .0012,
"20" => .0045,
"21" => .0032,
"22" => .0025,
"23" => .0044,
"24" => .0018,
"25" => .0022,
"26" => .0019,
"27" => .0035,
"28" => .0033,
"29" => .0034,
"30" => .0042);
$graph->addData($data);
$graph->setTitle('Graficos de Pontos');
$graph->setBars(false);
$graph->setLine(true);
$graph->setDataPoints(true);
$graph->setDataPointColor('blue');
$graph->setDataValues(true);
$graph->setDataValueColor('maroon');
$graph->setGoalLine(.0025);
$graph->setGoalLineColor('red');
$graph->createGraph();

?>

Edited by scorch
Adicionado Geshi.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.