Example #1
0
<?php

use Atompulse\Graph\Graph;
$graph = new Graph(520, 280);
$data = array("Alpha" => 1145, "Beta" => 1202, "Cappa" => 1523, "Delta" => 1437, "Echo" => 949, "Falcon" => 999, "Gamma" => 1188);
$data2 = array("Alpha" => 898, "Beta" => 1498, "Cappa" => 1343, "Delta" => 1345, "Echo" => 1045, "Falcon" => 1343, "Gamma" => 987);
$graph->addData($data, $data2);
$graph->setBarColor('blue', 'green');
$graph->setTitle('Company Production');
$graph->setupYAxis(12, 'blue');
$graph->setupXAxis(20);
$graph->setGrid(false);
$graph->setLegend(true);
$graph->setTitleLocation('left');
$graph->setTitleColor('blue');
$graph->setLegendOutlineColor('white');
$graph->setLegendTitle('Week-37', 'Week-38');
$graph->setXValuesHorizontal(true);
$graph->createGraph();
Example #2
0
<?php

use Atompulse\Graph\Graph;
$graph = new Graph(350, 280);
$data = array("Roger" => 145, "Ralph" => 102, "Rhonda" => 123, "Ronaldo" => 137, "Rosario" => 149, "Robin" => 99, "Robert" => 88, "Rustof" => 111);
$graph->setBackgroundColor("black");
$graph->addData($data);
$graph->setBarColor('255, 255, 204');
$graph->setTitle('IQ Scores');
$graph->setTitleColor('yellow');
$graph->setupYAxis(12, 'yellow');
$graph->setupXAxis(20, 'yellow');
$graph->setGrid(false);
$graph->setGradient('silver', 'gray');
$graph->setBarOutlineColor('white');
$graph->setTextColor('white');
$graph->setDataPoints(true);
$graph->setDataPointColor('yellow');
$graph->setLine(true);
$graph->setLineColor('yellow');
$graph->createGraph();