Reputation: 205
Please someone give me a very detailed tutorial how to use PHPGraphLib with Codeigniter.
I have tried to use but it did not worked.
Upvotes: 0
Views: 328
Reputation: 6928
Here is an example of initializing a PHPGraphLib inside a Codeigniter controller.
<?php
function barras() {
$this->load->library('phpgraphlib');
$graph = new PHPGraphLib(350,200);
for ($j=1;$j<=$total;$j++) {
$graph->addData($data[$j]);
}
$graph->setBars(false);
$graph->setLine(true);
$graph->setDataPoints(true);
$graph->setTitle('Menciones por Canal dentro de : '.utf8_decode($camp).'');
$graph->setLineColor("#FF0000", "#1D669D","#E7DE1D","#AB9999","#002102","#BBDDFF","#D91012","#ABB291","#CC0022","#DD9922","#AB2211");
$graph->setDataPoints(false);
$graph->setDataPointColor('maroon');
$graph->setDataValueColor('maroon');
$graph->setGoalLine(.0025);
$graph->setGoalLineColor('red');
$graph->createGraph();
}
?>
Be sure to upload phpgraphlib inside you application/libraries folder Link to the Github library
Upvotes: 1