GRAPH DOESN'T APPEAR IN THE PAGE
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


12»»

GRAPH DOESN'T APPEAR IN THE PAGE Expand / Collapse
Author
Message
Posted 2/4/2008 10:01:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/5/2008 10:07:30 AM
Posts: 2, Visits: 5
line graph doesn't appear in the page. the only thing that appears in the page instead of the line graph is a text "Chart.". i cant figure out what is wrong with my code..


include("../Includes/FusionCharts.php");
include("../Includes/DBConn.php");

$patientID = $_GET['patientID'];
$strXML = "";

$get_das = mysql_query("SELECT DISTINCT DASSCORE, CONSULTDATE FROM CONSULTATION WHERE PATIENTID='$patientID' ORDER BY CONSULTDATE ASC");
$index = 0;
if(mysql_num_rows($get_das) == 0){
echo "asa";
}
else{
while($get_result = mysql_fetch_array($get_das, MYSQL_NUM))
{
$das_index[$index] = $get_result[0];
$date[$index] = $get_result[1];
$strXML .= "";

$index++;
}
}

$strXML .= "
";

echo renderChart("../FusionCharts/FCF_Line.swf", "", $strXML, "", 600, 300);



please help me with these. thanks.
Post #4353
Posted 2/5/2008 12:28:16 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: 2 days ago @ 2:56:41 AM
Posts: 704, Visits: 1,139
Hi,

You need to provide an id to the chart:

echo renderChart("../FusionCharts/FCF_Line.swf", "", $strXML, "ChartID1", 600, 300,false,false);

Also did you include the FusionCharts.js file?

<SCRIPT LANGUAGE="Javascript" SRC="../FusionCharts/FusionCharts.js"></SCRIPT>

If not you can try using renderChartHTML once :

echo renderChartHTML("../FusionCharts/FCF_Line.swf", "", $strXML, "ChartID1", 600, 300,false);

Regards,

Sudipto Choudhury
FusionCharts Team

Post #4361
Posted 2/5/2008 10:07:41 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/5/2008 10:07:30 AM
Posts: 2, Visits: 5
thanks. =)
Post #4376
Posted 2/20/2008 3:02:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/28/2008 7:31:39 AM
Posts: 6, Visits: 7
Hello Sudipto,

I was having the same problem as outlined in this thread and when I stumbled across this post I changed renderChart to renderChartHTML and it started working (well almost, invalid XML now but thats for another thread I guess) .. so that is good. Could you please explain the differences between renderChart and renderChartHTML please?

Many thanks


------------------------------------------
Xyber Wars - free browsed based MMOPRG
Post #4592
Posted 2/21/2008 5:03:35 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: 2 days ago @ 2:56:41 AM
Posts: 704, Visits: 1,139
hi,

1. RenderChartHTML is a basic function which adds a chart to a page using HTHML embedding method. This means the method will generate an HTML string that will contain help loading the chart. This is dones using <object>/<embed> elements. The returned strin might have similar structure.: (Injecting direct HTML to a page)

<object ......>
  <param name='movie' value='chart.swf'>
  <param name='...' value='...'>
...
<embed src='chart.swf' .....></object>

** RenderChartHTML eariler did not supprort RegisterWithJS fucntionality of the charts. The new version of the ASP.NET 20. method found in InfoSoftGLobal.FusionCharts class has made this available.

2.Whereas  RenderChart uses JavaScript embedding method. (This method is used to override the IE - "Click Here to Activate.." ). It creates a DIV and a some lines of JavaScript codes that creats a FusionCharts JavaScript Object.Using this object the charts is rendered inside the DIV. So this is path HTML and path JavaSCript injecting. The JavaScript will handle the injecting of the <object>/<embed> tages for the charts.

This method will render string close to this :

<div id="name_div" >THIS TEXT WILL BE REPLACED BY THE CHART</div>
<script type="text/javascipt" lanuage="javascript">
   var chrt_name=new FusionChrts("chart.SWG","name_id","......);
   if( strURL==true){

        chrt_name.setDataURL(URL);

}else{

        chrt_name.setDataXML(strXML);
}

chrt_name.render("name_div");

</script>

**** You need to add/include FusionCharts.js file (to <head> ) in HTML page.Otherwise the chart will not render.

[ Note that when you add a inject a javascript using another javascript, the injected javascript will not be executed. Hence we recommend not to use RenderChart in AJAX callback, since AJAX is JavaScript and this javascript wont execute the javascript injected by RenderChart() (Untill and unless you write code to extract out all JavaSctipt code and eval() them).

Regards,

Sudipto Choudhury
FusionCharts Team

Post #4643
Posted 3/25/2008 12:09:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/31/2008 6:26:04 AM
Posts: 3, Visits: 5
I just discovered that FusionCharts seems to choke and output "Chart" if the string passed to renderChart (but not to renderChartHTML) contains newlines (the character, in particular).

Saludos
Adriano
Post #5268
Posted 3/26/2008 6:51:53 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: 2 days ago @ 2:56:41 AM
Posts: 704, Visits: 1,139
Hi,

This may happen due to either of the 2 reasons.

1. You are not using FusionCharts.js or its not loaded : RenderChart() requires FusionCharts.js to be included in the page. Could you please try adding this to your Application Page using <script> tag?

2. You might be using ASP.NET.AJAX or some Tool of of ASP.NET.AJAX where this texts comes if you use RenderChart() method. For AJAX you should be using RenderChartHTML().

Regards,

Sudipto Choudhury
FusionCharts Team

Post #5284
Posted 3/27/2008 8:32:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/31/2008 6:26:04 AM
Posts: 3, Visits: 5
Ahem, no. The file FusionCharts.js was there, and it was loaded as soon as I removed the newlines from the code. And this was straight PHP code, no AJAX involved. For the record, this is Windows XP SP2, Apache 2.2, PHP 5.2.5, the error visible on both Firefox 2.0.0.12 and IE 7.

Saludos
Adriano
Post #5301