cstandard
Members-
Content count
6 -
Joined
-
Last visited
About cstandard
-
Rank
Forum Newbie
-
Is it possible to generate multiple charts on a single page using php and the data from database method? I have been using php to generate a variety of terrific charts pulling data directly from a MySQL database using php. I am not creating xml data files, so the example in the documentation does not help in this particular case. Can this be done by placing each chart in a separate ? Does anyone have any experience doing this? Thanks in advance.
-
Combination Charts with php and MySQL
cstandard replied to FusionCharts Support's topic in FusionCharts and PHP
Thanks for the help on this one. It turns out that it is is possible. The problem all along was the format of the array that passes the dataset parameters to the I hope this little snippet of code will help others to see how to do it. I only added paremeters for color and renderAs, just to prove the array syntax was correct. # Fetch all necessary database records creating SQL query $strQuery = "select Height,Weight,Fecha from php_Charts where Name=" . $person . " order by Fecha"; $result = mysql_query($strQuery) or die(mysql_error()); #Pass the SQL query result and format to PHP Class Function # this function will automatically add chart data from database if ($result) { # Add category names --- Appears not to be needed with datasetsa # $FC->addCategoryFromDatabase($result, "Fecha"); $ctrlField = "Fecha"; $valueField = "Height;Weight"; $datasetParamArray = array("renderAs=Area; Color=008800", "Color=880000; "); $FC->addDatasetsFromDatabase($result,$ctrlField,$valueField,$datasetParamArray,""); } mysql_close($link); # Create the chart $FC->renderChart(); ?> Thanks again! Happy Charting! -
Combination Charts with php and MySQL
cstandard replied to FusionCharts Support's topic in FusionCharts and PHP
Dear Rajroop: Thank you for your reply. I am very familiar with both of the references you provided. I am an experienced FusionCharts user, and I have had great success generating charts of all types from the FusionCharts and PowerCharts portfolio. They are beautiful and professional, and I always receive comments regarding them. Until now, I have been using ".xml" data files coupled with ".html" parent files, which would define the path/filename of the data file, set the size parameters, number of charts on the page, etc. Now I have a need to produce these charts from data being stored in MySQL. I have been able to follow your examples from the documentation and have modified them to develop several of my own graphs. However, I need to make the combination charts similar to what I have made in the past (similar to what is shown in the reference you provided) using php from MySQL data. I wish to pass the variable directly from MySQL because I do not want to use the URL or xml method. I am unclear on how to call the correct chart and how to pass the category names, data, and parameters such as renderAs='Line' or renderAs='Area'. I do not expect to have any trouble with the MySQL strings, but I need a little help with the php. Can you please help me with a detaiked explanation of how to do this or some sample code? Thank you in advance for helping me in this matter. Respectfully, Charles Thomas Standard -
Is it possible to generate a "single axis" combination chart from MySQL data using php class? I need to plot "columns" "lines" and "areas" on the same chart AND on the same axis. Coould someone please help with an explanation and some sample code?