Jump to content


Help With Fusioncharts Free, Php And Javascript - Multiseries


  • Please log in to reply
9 replies to this topic

#1 imai

imai

    Forum Newbie

  • Members
  • 6 posts

Posted 02 August 2012 - 05:23 AM

Hi, I'm newbie here.. so i really appreciate any help from all of you..
i really really need help here..
currently i'm using fusionChart free for creating chart in my website, and i create it using PHP file and the data are from database (Mysql)
then, i wanna create multi series line chart, could anyone tell me how to create datasets and categories from the database and then call the php file using Javascript?
because i can't find the documentation about it.. Posted Image the documentation that i found just creating pie3D chart there is none using multi series line chart
any help would be greatly appreciated.!!
thank you

Edited by imai, 02 August 2012 - 05:24 AM.


#2 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1979 posts
  • LocationBangalore

Posted 02 August 2012 - 10:27 AM

Hi,

This might help you,

Please refer this post: http://forum.fusionc...chartssql-noob/
Thanks,
Sumedh

Follow us @Twitter!

#3 imai

imai

    Forum Newbie

  • Members
  • 6 posts

Posted 03 August 2012 - 08:01 AM

Hi,

This might help you,

Please refer this post: http://forum.fusionc...chartssql-noob/



hi, thanks a lot for your help it really helps me..
i tried to do like and i still got error "Invalid XML" and "XML not well formed" is it because my data are not counted as like their data.? actually i just wanna display many columns of my database and it becomes the legend..
could i do that.?
my code is like this :


<?php
$dbConn = mysql_connect('localhost', 'root', '') or die("Connection to database failed, perhaps the service is down !!");
mysql_select_db('nsasouth') or die("Database name not available !!");

$strXML = "<graph caption='Data' decimalPrecision='1' showNames='1' formatNumberScale='0'><categories>";
$strQuery = "select DATE, TCH_DROP_, TCH_BLOCK_, SDCCH_DROP_, SDSR_, SD_BLOCK_RATE_, TBF_DL_ESTABLISHMENT_SUCCESS_RATE_, TBF_UL_ESTABLISHMENT_SUCCESS_RATE_, TBF_COMPLETION_SUCCESS_RATE_, HOSR_ from nsa";
$result = mysql_query($strQuery) or die(mysql_error());
while($ors = mysql_fetch_array($result))
{
	$strXML = "<category name='".$ors['DATE']."'/>";
}
$strXML .= "</categories><dataset seriesname = 'TCH_DROP'>";

$result2 = mysql_query($strQuery) or die(mysql_error());
while($ors1= mysql_fetch_array($result2))
{
	$strXML .= "<set value='".$ors1['TCH_DROP_']."'/>";
}

$strXML .= "</dataset><dataset seriesname = 'TCH_BLOCK'>";
$result3 = mysql_query($strQuery) or die(mysql_error());
while($ors2 = mysql_fetch_array($result3))
{
	$strXML .= "<set value='".$ors2['TCH_BLOCK_']."'/>";
}
$strXML .= "</dataset></graph>"; 
//echo $strXML;
header('Content-type: text/xml');
#Return the chart XML for Column 3D Chart 
print $strXML; 

?>


and i'm getting not well formed in </categories>
i don't know what should i do..
i really appreciate for your help.. thanks a lot.

Edited by imai, 03 August 2012 - 08:02 AM.


#4 Sashibhusan

Sashibhusan

    Supreme Being

  • Members
  • PipPipPipPipPipPipPipPip
  • 587 posts

Posted 03 August 2012 - 10:20 AM

Hi,

It seems the code is correct and build the chart XML in a correct way for MSLine chart.

Could you please try echoing the values of "$ors['DATE']" , "$ors1['TCH_DROP_']" and "$ors2['TCH_BLOCK_']" and check whether you are getting correct values from the database table?

If this is what is not able to resolve your issue, could you please send us the generated XML output, to look into your issue?

Awaiting your response !

#5 imai

imai

    Forum Newbie

  • Members
  • 6 posts

Posted 06 August 2012 - 07:04 AM

Hi,

It seems the code is correct and build the chart XML in a correct way for MSLine chart.

Could you please try echoing the values of "$ors['DATE']" , "$ors1['TCH_DROP_']" and "$ors2['TCH_BLOCK_']" and check whether you are getting correct values from the database table?

If this is what is not able to resolve your issue, could you please send us the generated XML output, to look into your issue?

Awaiting your response !

hi, thanks a lot for your reply.. i tried to check the values and they are correct values from my database table
and this is when i generate the XML.. i attach the image i got error in line 1 column 30 i have no idea about the syntax..
really thanks a lot for your help

Attached Thumbnails

  • Capture.JPG

Edited by imai, 06 August 2012 - 07:06 AM.


#6 Sashibhusan

Sashibhusan

    Supreme Being

  • Members
  • PipPipPipPipPipPipPipPip
  • 587 posts

Posted 06 August 2012 - 12:43 PM

Hey,

Could you please confirm, which chart type (the SWF file name) you are using for rendering the graph?

It seems from the comment line of your code (posted on 03 Aug 2012), "#Return the chart XML for Column 3D Chart".

But you are forming the XML for MultiSeries graph.

Please use "FCF_MSLine.swf " file for rendering your graph and do share the feedback with us.

If this not helps, could you please provide the complete XML output to look into your issue?

Edited by Sashibhusan, 06 August 2012 - 12:44 PM.


#7 imai

imai

    Forum Newbie

  • Members
  • 6 posts

Posted 08 August 2012 - 07:57 AM

Hey,

Could you please confirm, which chart type (the SWF file name) you are using for rendering the graph?

It seems from the comment line of your code (posted on 03 Aug 2012), "#Return the chart XML for Column 3D Chart".

But you are forming the XML for MultiSeries graph.

Please use "FCF_MSLine.swf " file for rendering your graph and do share the feedback with us.

If this not helps, could you please provide the complete XML output to look into your issue?


hey, i really thanks a lot for your fast reply..
i checked it and yeah i got wrong about the chart type but when i changed it.. it did not work at all..
so i tried to delete the code that creates "categories" and it could provide correct XML but when i added it again i got wrong again and it said not well formed..
the XML output is like this :


XML Parsing Error: not well-formed
Location: http://localhost/lala.php
Line Number 1, Column 30:

<category name='30-Jun-12'/></categories>
------------------------------------------^
<dataset seriesname = 'TCH_DROP'>
<set value='0.78'/>
<set value='0.82'/>
<set value='1.38'/>
<set value='0.75'/>
<set value='0.6'/>
</dataset>
<dataset seriesname = 'TCH_BLOCK'>
<set value='0'/>
<set value='0'/>
<set value='0'/>
<set value='0'/>
<set value='0'/>
</dataset>
</graph>

really thanks a lot for your help

#8 Sashibhusan

Sashibhusan

    Supreme Being

  • Members
  • PipPipPipPipPipPipPipPip
  • 587 posts

Posted 09 August 2012 - 10:14 AM

Hey,

From the XML output, it seems that the complete XML is not coming out.

Could you please modify a bit of your code by concatenating the "$strXML" string while forming the "category" elements?

Ref. Code:

while($ors = mysql_fetch_array($result))
{
    	$strXML .= "<category name='".$ors['DATE']."'/>";
}


Hope this helps !

Edited by Sashibhusan, 09 August 2012 - 10:15 AM.


#9 imai

imai

    Forum Newbie

  • Members
  • 6 posts

Posted 10 August 2012 - 02:26 PM

Hey,

From the XML output, it seems that the complete XML is not coming out.

Could you please modify a bit of your code by concatenating the "$strXML" string while forming the "category" elements?

Ref. Code:


while($ors = mysql_fetch_array($result))
{
    	$strXML .= "<category name='".$ors['DATE']."'/>";
}


Hope this helps !


hey, i modified the code.. and it really worked.. thanks a lot Sashibhusan
really thanks a lot Posted Image

#10 Bindhu

Bindhu

    Supreme Being

  • Members
  • PipPipPipPipPipPipPipPip
  • 748 posts
  • LocationBangalore

Posted 11 August 2012 - 08:13 AM

:)
Help us improve our documentation with your precious feedback at:
[url]http://documentation-survey.g.fusioncharts.com/[/url]

Thank you,
Bindhu

Follow us <[url]http://http//twitter.com/fusioncharts>[/url] @Twitter!