ninedoors Posted April 10, 2008 Share Posted April 10, 2008 Can anyone see what is wrong with my call to AdjBackgroundImage function. If I take it out then it works fine. But I would liek to be able to fade the image into the background so I kind of need it. I tried to find the function in the jpgraph.php file but had no luck(there is a couple thousand lines of code so I'm not sure if I missed it). Does anyone know if that function was remove for the 2.3 version? I can't see it but maybe. Anyways here's the code I'm using: <?php include ('C:\xampp\htdocs\PTL\jpgraph-2.3\src\jpgraph.php'); include ('C:\xampp\htdocs\PTL\jpgraph-2.3\src\jpgraph_bar.php'); include_once 'graphfunctions/mac1history.php'; $startdate = '2007-05-01'; $enddate = '2007-06-01'; //Some data include 'config/PMAconfig.php'; //Connect to apache server(MySQL) and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); list ($xdata, $ydata) = mac1history($startdate, $enddate); //format date for graph $date = new DateTime($startdate); $sdate = $date->format("M. j/y"); $date = new DateTime($enddate); $edate = $date->format("M. j/y"); $finaldate = $sdate . ' to ' . $edate; //New graph with a drop shadow $graph = new Graph(600,300,'auto'); $graph->SetShadow(); //Use a "text" X-scale $graph->SetScale("textlin"); $graph->img->SetMargin(50,30,50,60); $graph->SetBackgroundImage("images/lauder.jpg",BGIMG_FILLFRAME); $graph->AdjBackgroundImage(0.4, 0.7, -1); //Specify X-labels $graph->xaxis->SetTickLabels($xdata); $graph->xaxis->SetLabelAngle(90); // Set title and subtitle $graph->title->Set("PTL History - MAC Line 1"); $graph->title->SetColor('navy'); $graph->subtitle->Set($finaldate); //Use built in font $graph->title->SetFont(FF_ARIAL,FS_BOLD); //Create the bar plot $bplot = new BarPlot($ydata); $bplot->SetLegend("Eaches"); // Setup color for gradient fill style $bplot->SetFillGradient("navy","lightsteelblue",GRAD_HOR); //$b1->SetAbsWidth(6); //$b1->SetShadow(); //The order the plots are added determines who's ontop $graph->Add($bplot); //Finally output the image $graph->Stroke('graphs/maconehistory.jpeg'); ?> And the error code I get is Fatal error: Call to undefined method Graph::AdjBackgroundImage() in C:\xampp\htdocs\PTL\ptl-history1.php on line 36. Thanks Link to comment https://forums.phpfreaks.com/topic/100504-jpgraph-problems/ Share on other sites More sharing options...
GingerRobot Posted April 10, 2008 Share Posted April 10, 2008 You may have better luck contacting the author of the class - unless anyone here is using the same class it's unlikely we'll be able to help you. Given the error message, that method obviously doesn't exist. Link to comment https://forums.phpfreaks.com/topic/100504-jpgraph-problems/#findComment-514001 Share on other sites More sharing options...
ninedoors Posted April 10, 2008 Author Share Posted April 10, 2008 Ok, Thanks Link to comment https://forums.phpfreaks.com/topic/100504-jpgraph-problems/#findComment-514004 Share on other sites More sharing options...
GingerRobot Posted April 10, 2008 Share Posted April 10, 2008 A quick search on the forums for the class produced this: The function "adjbackgroundimage()" has been removed after the shift to GD2 since that function only worked for older pallette based images (that was the original scope for GD1) anyway. It is simply not feasible to do that kind of image manipulation on TrueColor images. Rgds Johan Link to comment https://forums.phpfreaks.com/topic/100504-jpgraph-problems/#findComment-514009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.