Luís Antônio
unread,Oct 9, 2013, 11:43:54 AM10/9/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to go...@googlegroups.com
Estou criando um gráfico em pizza utilizando a JPGraph.
Quando utilizo:
$vagasPreenchidas = 50;
O gráfico é gerado sem problemas, mas quando utilizo:
$conexao = new conexao();
$vagasPreenchidas = (int)$conexao->pegarDentro();
Ele não gera o gráfico.
Alguém poderia me ajudar?
<?php
...
function validarVagas(){
$vagasDisponiveis = 300; // Sempre será fixo em 300
//$vagasPreenchidas = 50; // Ao utilizar este comenta-se
$conexao = new conexao();
$vagasPreenchidas = (int)$conexao->pegarDentro();
$vagasExcedentes = $vagasPreenchidas - $vagasDisponiveis;
$vagasDisponiveis -= $vagasPreenchidas;
if ($vagasExcedentes > 0) {
global $vagas, $cores;
$cores = array(0 => 'yellow', 1 => 'red');
$vagas = array(0 => $vagasPreenchidas, 1 => $vagasExcedentes);
} else {
global $vagas, $cores, $p1;
$cores = array(0 => 'blue', 1 => 'yellow');
$vagas = array(0 => $vagasDisponiveis, 1 => $vagasPreenchidas);
}
}
...
validarVagas();
$p1 = new PiePlot($vagas);
?>