gladiator83x Posted July 26, 2006 Share Posted July 26, 2006 I downloaded this graphing class and tried the sample code located here:http://members.aol.com/barryaandrew/baaChart/baachartguide.html#samplesHowever, my graphs dont show up-- I get the following errors:-------------------------------------------------------------------Warning: main(baaChart.php) [function.main]: failed to open stream: No such file or directory in /export/home2/webpages/baa.php on line 2Warning: main() [function.include]: Failed opening 'baaChart.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /export/home2/webpages/baa.php on line 2Fatal error: Class 'baaChart' not found in /export/home2/webpages/baa.php on line 3-----------------------------------------------------------------I believe I have the gd library installed-- Is anyone familiar w/ graphing?Also, is there anyway to put a column of dates in order in mysql?--I was looking to see if there was maybe some kind of function. Quote Link to comment https://forums.phpfreaks.com/topic/15727-help-using-baachart/ Share on other sites More sharing options...
ShogunWarrior Posted July 26, 2006 Share Posted July 26, 2006 The problem is your script can't find baachart.php, possibly because you have the Baachart class in a subfolder or your script is in the wrong folder. Quote Link to comment https://forums.phpfreaks.com/topic/15727-help-using-baachart/#findComment-64266 Share on other sites More sharing options...
gladiator83x Posted July 26, 2006 Author Share Posted July 26, 2006 baachart.php is the class-- the actual file has the following code:include('baaChart.php'); $mygraph = new baaChart(600); $mygraph->setTitle('Regional Sales','Jan - Jun 2002'); $mygraph->setXLabels("Jan,Feb,Mar,Apr,May,Jun"); $mygraph->addDataSeries('L',LINE_MARK_X,"25,30,35,40,30,35","South"); $mygraph->addDataSeries('L',LINE_MARK_CIRCLE,"65,70,80,90,75,48","North"); $mygraph->addDataSeries('L',LINE_MARK_SQUARE,"12,18,25,20,22,30","West"); $mygraph->addDataSeries('L',LINE_MARK_DIAMOND,"50,60,75,80,60,75","East"); $mygraph->addDataSeries('L',LINE_MARK_NONE,"30,45,50,55,52,60","Europe"); $mygraph->setBgColor(255,255,255,1); //Transparent $mygraph->setXAxis("Month",1); $mygraph->setYAxis("Sales (£000)",0,100,10,0); $mygraph->drawGraph(); Quote Link to comment https://forums.phpfreaks.com/topic/15727-help-using-baachart/#findComment-64270 Share on other sites More sharing options...
Barand Posted July 26, 2006 Share Posted July 26, 2006 Save the code in a file, say, mychart.php.:: mychart.php ::[code]<?phpinclude('baaChart.php'); $mygraph = new baaChart(600); $mygraph->setTitle('Regional Sales','Jan - Jun 2002'); $mygraph->setXLabels("Jan,Feb,Mar,Apr,May,Jun"); $mygraph->addDataSeries('L',LINE_MARK_X,"25,30,35,40,30,35","South"); $mygraph->addDataSeries('L',LINE_MARK_CIRCLE,"65,70,80,90,75,48","North"); $mygraph->addDataSeries('L',LINE_MARK_SQUARE,"12,18,25,20,22,30","West"); $mygraph->addDataSeries('L',LINE_MARK_DIAMOND,"50,60,75,80,60,75","East"); $mygraph->addDataSeries('L',LINE_MARK_NONE,"30,45,50,55,52,60","Europe"); $mygraph->setBgColor(255,255,255,1); //Transparent $mygraph->setXAxis("Month",1); $mygraph->setYAxis("Sales (£000)",0,100,10,0); $mygraph->drawGraph();?>[/code]In another page, have an image tag to place the chart on the page as you would with any image file[code]<img src='mychart.php'>[/code]Make sure that 'baachart.php' is in a folder defined in the "include_path" in your php.ini file. If you are on a nix system the filename will be case-sensitive so make sure the included filename matches the actual filename. Quote Link to comment https://forums.phpfreaks.com/topic/15727-help-using-baachart/#findComment-64294 Share on other sites More sharing options...
gladiator83x Posted July 26, 2006 Author Share Posted July 26, 2006 Thanks Barand! 8) Quote Link to comment https://forums.phpfreaks.com/topic/15727-help-using-baachart/#findComment-64306 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.