mr.fab Report post Posted September 4, 2013 (edited) Hi All, I have developed a line chart in PHP using Fusion Chart.but I'm not good at SQL. I want lines to show these Jan Feb Mar Apr May Jun Jul 5 9 0 2 8 5 4 How I do that.? Thank you. report-month6.php Edited September 4, 2013 by mr.fab Share this post Link to post Share on other sites
Guest Sashibhusan Report post Posted September 6, 2013 (edited) Hi, For the "report-month6.php" it seems, you are building the XML data string in a correct way. However, the fetching of data is depending on your database table structure. You would need to create the XML string as per the FusionCharts XML data format, no matter the form of data you have. So, in your case the XML structure would be something like below: <chart legendPostion='' caption='Factory Output report' subCaption='By Quantity' xAxisName='Factory' yAxisName='Units' showValues='0' formatNumberScale='0' rotateValues='1' animation='1'> <categories> <category label='Jan' /> <category label='Feb' /> <category label='Mar' /> <category label='Apr' /> <category label='May' /> <category label='Jun' /> <category label='Jul' /> </categories> <dataset seriesName='2006'> <set value='5' /> <set value='9'/> <set value='0' /> <set value='2' /> <set value='8' /> <set value='5' /> <set value='4' /> </dataset> </chart> However, in your PHP code it seems, you are appending "$ors[$valueField]" ($valueFiels takes "Quantity") to the value attribute in <set> element, but your query result is returning two columns "Month" and "Units sold". Could you please try echoing "$strXML" and check whether the XML string generated is correct as per the sample provided above and modify your PHP code accordingly, if require? Hope this helps! Edited September 6, 2013 by Sashibhusan Share this post Link to post Share on other sites