veerugadde Report post Posted June 15, 2009 Hello, I am trying to add the chart data from mysql database using php class.But for particular case of data query,i was unable to figure out as how to add the data to chart. for example: SELECT value1 as Totalmarks,value2 as English,value3 as Maths,value4 as Science FROM SchooData; from the above sample query,i want to show the totalmarks alongwith marks from english,math and science subjects in a single charts.I tried to use addDataFromDatabase() but it's showing only one value.i also tried with addDatasetsFromDatabase() but was unable to figure out. Can anyone please help me out with above problem? Thanks, veerendra Share this post Link to post Share on other sites
veerugadde Report post Posted June 16, 2009 Can anyone please suggest a solution to my question? Share this post Link to post Share on other sites
maria Report post Posted June 29, 2009 The way I've tried doing this is using PHP to query the database, save the result, and use it to construct an XML string. The documentation has a section that discusses "Plotting from Database" Maria Share this post Link to post Share on other sites
Rahul Kumar Report post Posted June 30, 2009 Hi veerugadde, Could you please show us the results of your SQL query in tabular format, because it seems that it is returing more than one row. And if this is the case then chart will show the repeated numbers of data for all columns (Totalmarks, English, Maths, Science). So you would need to change your sql query to get the desire result. However, a solution would be like this: .... .... ..... $ors = mysql_fetch_array($result) $FC->addChartData($ors['value1 '],'label=Totalmarks');$FC->addChartData($ors['value2'],'label=English'); $FC->addChartData($ors['value3 '],'label=Maths');$FC->addChartData($ors['value4'],'label=Science'); $FC->renderChart();.... ..... Share this post Link to post Share on other sites