JPGraph wont display when trying to use oracle database data

48 Views Asked by At

Currently trying to display some data from a database in JPGraph. The JPGraph displays when putting data in manually but when trying to use a variable it no longer displays.

I'm still learning how to use oracle as i'm more used to MySQL so the error could lie in how I have tried to retrieve the oracle data.

Any advice?

Here is the php used:

<?php // content="text/plain; charset=utf-8"

$conn = oci_connect('Username', 'Groupassignment2020', 'db_link');

if (!$conn) {   

$e = oci_error();   

trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);

}

$selectBudget = oci_parse($conn, "SELECT BUDGET FROM REVENUE");
oci_execute($selectBudget);

require_once ('src/jpgraph.php');
require_once ('src/jpgraph_bar.php');

$data1y=array($selectBudget);

// Create the graph. These two calls are always required
$graph = new Graph(1400,800,'auto');
$graph->SetScale("textlin");

$theme_class=new UniversalTheme;
$graph->SetTheme($theme_class);

$graph->yaxis->SetTickPositions(array(0,30,60,90,120,150), array(15,45,75,105,135));
$graph->SetBox(false);

$graph->ygrid->SetFill(false);
$graph->xaxis->SetTickLabels(array('A','B','C','D'));
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);

// Create the bar plots
$b1plot = new BarPlot($data1y);
$b2plot = new BarPlot($data2y);
$b3plot = new BarPlot($data3y);

// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($b1plot,$b2plot,$b3plot));
// ...and add it to the graPH
$graph->Add($gbplot);


$b1plot->SetColor("white");
$b1plot->SetFillColor("#768692");

$b2plot->SetColor("white");
$b2plot->SetFillColor("#0072CE");

$b3plot->SetColor("white");
$b3plot->SetFillColor("#41B6E6");

$graph->title->Set("Bar Plots");

// Display the graph
$graph->Stroke();
?>
0

There are 0 best solutions below