Skip to content

Instantly share code, notes, and snippets.

@jlamim
Last active June 9, 2016 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlamim/9d66e3f7d675957199d29b19ef84f242 to your computer and use it in GitHub Desktop.
Save jlamim/9d66e3f7d675957199d29b19ef84f242 to your computer and use it in GitHub Desktop.
Gráfico simples com CodeIgniter e PHPlot
public function Index(){
// Carregamos a library PHPlot
$this->load->library('PHPlot');
//Definindo os dados do gráfico
$dados = array(
array('a',3),
array('b',5),
array('c',7),
array('d',8),
array('e',2),
array('f',6),
array('g',7)
);
$this->phplot->SetDataValues($dados);
//Imprimindo o gráfico na tela
$this->phplot->DrawGraph();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment