|
User Details |
message
|
|
Damion Mchenry
post date:
2010-12-07 22:45:20
|
Ok,
So i just purchased a license and after I generate a dynamic chart and upload it to the server, along with the includes files I get this error:
call to undefined function renderFusionChart()
So I look at the source file and sure enough, these lines:
<?php include('../includes/FusionCharts/dynamic/DWFChart.inc.php'); ?>
<?php
// fusion chart # FusionChart2 data include
include('../includes/FusionCharts/dynamic/data/fc_FusionChart2_data.php');
Are below the line
renderFusionChart($dFCFusionChart2, 400, 400);
So I move them above and the undefined function goes away, but now I get:
Fatal error: Call to a member function render() on a non-object in /home/dmchenry/public_html/includes/FusionCharts/dynamic/DWFChart.inc.php on line 7
I have not been able to successfully generate a dynamic chart???? It's driving me nuts!
|
|
|
Damion Mchenry
post date:
2010-12-07 23:22:14
|
Here is the file in it's entirety so in case you need to see it:
<?php require_once('../Connections/ixschart.php'); ?><?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
// fusion chart recordset
mysql_select_db($database_ixschart, $ixschart);
$fcquery_FusionChart3_rs0 = "SELECT count(pluggins.key_number) AS xtd_value, SUBSTRING(CAST(pluggins.date AS char), 1, 2) AS xtd_date, ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) AS xtd_date_part, pluggins.date FROM pluggins WHERE ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) >= 1 AND ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) <= 12 AND 1 GROUP BY xtd_date";
$FusionChart3_rs0 = mysql_query($fcquery_FusionChart3_rs0, $ixschart) or die(mysql_error());
$row_FusionChart3_rs0 = mysql_fetch_assoc($FusionChart3_rs0);
$totalRows_FusionChart3_rs0 = mysql_num_rows($FusionChart3_rs0);
?><?php
// (FCChart Begin) #FusionChart2
renderFusionChart($dFCFusionChart2, 400, 400);
// #FusionChart2 (FCChart End)
?><?php
// (FCChart Begin) #FusionChart3
renderFusionChart($dFCFusionChart3, 400, 400);
// #FusionChart3 (FCChart End)
?>
<?php require_once('../Connections/ixschart.php'); ?><?php include('../includes/FusionCharts/dynamic/DWFChart.inc.php'); ?><?php
// fusion chart # FusionChart2 data include
include('../includes/FusionCharts/dynamic/data/fc_FusionChart2_data.php');
// fusion chart # FusionChart3 data include
include('../includes/FusionCharts/dynamic/data/fc_FusionChart3_data.php');
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
// fusion chart #FusionChart2 dynamic filter data
// fusion chart #FusionChart3 dynamic filter data
// fusion chart recordset
mysql_select_db($database_ixschart, $ixschart);
$fcquery_FusionChart2_rs0 = "SELECT count(pluggins.key_number) AS xtd_value, SUBSTRING(CAST(pluggins.date AS char), 1, 2) AS xtd_date, ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) AS xtd_date_part, pluggins.date FROM pluggins WHERE ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) >= 1 AND ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) <= 12 AND 1 GROUP BY xtd_date";
$FusionChart2_rs0 = mysql_query($fcquery_FusionChart2_rs0, $ixschart) or die(mysql_error());
$row_FusionChart2_rs0 = mysql_fetch_assoc($FusionChart2_rs0);
$totalRows_FusionChart2_rs0 = mysql_num_rows($FusionChart2_rs0);
$dFCFusionChart2 = new DWFChart("FusionChart2", "Line", "../includes/FusionCharts/charts/", 400, 400, "", "", "", "", "", "");
$dFCFusionChart2->setConfigXML($FusionChart2_dataXML);
$dFCFusionChart2->setCategory($NoRecordset, "", "", "date");
$dFCFusionChart2->addSeries($FusionChart2_rs0, "pluggins.key_number", "series_group_type=month;full_date=0;series_date_format=mm/dd/yyyy;series_date_display=month_no;min_val=1;series_value_col=pluggins.key_number;series_table=pluggins;max_val=12;series_date_col=pluggins.date;series_calculation=count", "color='f101f6' seriesName='pluggins.key_number'", "default", "");
$dFCFusionChart2->setOrdering('None', 'asc');
$dFCFusionChart2->prepareData();
$dFCFusionChart3 = new DWFChart("FusionChart3", "Line", "../includes/FusionCharts/charts/", 400, 400, "", "", "", "", "", "");
$dFCFusionChart3->setVersion("1.1.1");
$dFCFusionChart3->setConfigXML($FusionChart3_dataXML);
$dFCFusionChart3->setCategory($NoRecordset, "", "", "date");
$dFCFusionChart3->addSeries($FusionChart3_rs0, "pluggins.key_number", "series_group_type=month;full_date=0;series_date_format=mm/dd/yyyy;series_date_display=month_no;min_val=1;series_value_col=pluggins.key_number;series_table=pluggins;max_val=12;series_date_col=pluggins.date;series_calculation=count", "color='65be94' seriesName='pluggins.key_number'", "default", "");
$dFCFusionChart3->setOrdering('None', 'asc');
$dFCFusionChart3->prepareData();
?>
<?php
mysql_free_result($FusionChart2_rs0);
mysql_free_result($FusionChart3_rs0);
?>
|
|
|
Andrei Rinciog [Extend Studio]
post date:
2010-12-08 04:30:51
|
Hello,
You need to place the render functions inside a HTML tag for the chart to function. Also, the calls need to be placed after the include functions.
Best thing to do is to place <html> and <body> tags aboce the mysql_free_result functions. Inside the tags copy the php with the render function calls.
Tell me if you have any more questions.
Regards,
Andrei Rinciog
|
|
|
Damion Mchenry
post date:
2010-12-08 15:14:36
|
As I suspected, putting the render functions within an HTML tag did not change the php error....I also moved all the includes to the top of the file. Here is what the code now looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php require_once('../Connections/ixschart.php'); ?>
<?php include('../includes/FusionCharts/dynamic/DWFChart.inc.php'); ?>
<?
require_once('../Connections/ixschart.php'); ?><?php
// fusion chart # FusionChart2 data include
include('../includes/FusionCharts/dynamic/data/fc_FusionChart2_data.php');
// fusion chart # FusionChart3 data include
include('../includes/FusionCharts/dynamic/data/fc_FusionChart3_data.php');
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
// fusion chart recordset
mysql_select_db($database_ixschart, $ixschart);
$fcquery_FusionChart3_rs0 = "SELECT count(pluggins.key_number) AS xtd_value, SUBSTRING(CAST(pluggins.date AS char), 1, 2) AS xtd_date, ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) AS xtd_date_part, pluggins.date FROM pluggins WHERE ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) >= 1 AND ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) <= 12 AND 1 GROUP BY xtd_date";
$FusionChart3_rs0 = mysql_query($fcquery_FusionChart3_rs0, $ixschart) or die(mysql_error());
$row_FusionChart3_rs0 = mysql_fetch_assoc($FusionChart3_rs0);
$totalRows_FusionChart3_rs0 = mysql_num_rows($FusionChart3_rs0);
?><?php
// (FCChart Begin) #FusionChart2
renderFusionChart($dFCFusionChart2, 400, 400);
// #FusionChart2 (FCChart End)
?><?php
// (FCChart Begin) #FusionChart3
renderFusionChart($dFCFusionChart3, 400, 400);
// #FusionChart3 (FCChart End)
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
// fusion chart #FusionChart2 dynamic filter data
// fusion chart #FusionChart3 dynamic filter data
// fusion chart recordset
mysql_select_db($database_ixschart, $ixschart);
$fcquery_FusionChart2_rs0 = "SELECT count(pluggins.key_number) AS xtd_value, SUBSTRING(CAST(pluggins.date AS char), 1, 2) AS xtd_date, ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) AS xtd_date_part, pluggins.date FROM pluggins WHERE ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) >= 1 AND ( SUBSTRING(CAST(pluggins.date AS char), 1, 2) ) <= 12 AND 1 GROUP BY xtd_date";
$FusionChart2_rs0 = mysql_query($fcquery_FusionChart2_rs0, $ixschart) or die(mysql_error());
$row_FusionChart2_rs0 = mysql_fetch_assoc($FusionChart2_rs0);
$totalRows_FusionChart2_rs0 = mysql_num_rows($FusionChart2_rs0);
$dFCFusionChart2 = new DWFChart("FusionChart2", "Line", "../includes/FusionCharts/charts/", 400, 400, "", "", "", "", "", "");
$dFCFusionChart2->setConfigXML($FusionChart2_dataXML);
$dFCFusionChart2->setCategory($NoRecordset, "", "", "date");
$dFCFusionChart2->addSeries($FusionChart2_rs0, "pluggins.key_number", "series_group_type=month;full_date=0;series_date_format=mm/dd/yyyy;series_date_display=month_no;min_val=1;series_value_col=pluggins.key_number;series_table=pluggins;max_val=12;series_date_col=pluggins.date;series_calculation=count", "color='f101f6' seriesName='pluggins.key_number'", "default", "");
$dFCFusionChart2->setOrdering('None', 'asc');
$dFCFusionChart2->prepareData();
$dFCFusionChart3 = new DWFChart("FusionChart3", "Line", "../includes/FusionCharts/charts/", 400, 400, "", "", "", "", "", "");
$dFCFusionChart3->setVersion("1.1.1");
$dFCFusionChart3->setConfigXML($FusionChart3_dataXML);
$dFCFusionChart3->setCategory($NoRecordset, "", "", "date");
$dFCFusionChart3->addSeries($FusionChart3_rs0, "pluggins.key_number", "series_group_type=month;full_date=0;series_date_format=mm/dd/yyyy;series_date_display=month_no;min_val=1;series_value_col=pluggins.key_number;series_table=pluggins;max_val=12;series_date_col=pluggins.date;series_calculation=count", "color='65be94' seriesName='pluggins.key_number'", "default", "");
$dFCFusionChart3->setOrdering('None', 'asc');
$dFCFusionChart3->prepareData();
?>
<?php
mysql_free_result($FusionChart2_rs0);
mysql_free_result($FusionChart3_rs0);
?>
</body>
</html>
And you can see the error here:
http://ixsweb.com/chart/test2.php
|
|
|
Damion Mchenry
post date:
2010-12-08 15:18:35
|
Ok, I've gotten past the php error...I had to move the render chart to the very bottom of the page before the mysql_free_result....
I don't know why this program put everything in the wrong order...
Now I'm just getting a page that says "chart"...I'll see if i can figure that out now.
|
|
|
Damion Mchenry
post date:
2010-12-08 17:14:03
|
|
Arrrrghhh...it looks like the FusionCharts.js file was not being included.....shouldn't this script include all the necessary files and include them in the correct order?
|
|
|
Andrei Rinciog [Extend Studio]
post date:
2010-12-09 03:56:15
|
Hello,
The JS file wasn't included because you didn't have a <head> tag in the page. The extension needs to be included in a page that has the basic HTML tags in order to function. After that, you may strip the page of those tags, but it important that they are in the page when you insert the chart.
Regards,
Andrei Rinciog
|
|