Sign in to follow this  
FusionCharts Support

using $strXML not working

Recommended Posts

I'm in pre-purchasing fase, trying to get things working.

While dataURL works fine, strXML doesn't.

I specific want to use the strXML-method, just because I don't want every graph to be build by a fysically file on my server.

When using strXML and renderchart I get:

debug error: Could not find dataxml or dataurl

any comments on this code?

$strXML=

<chart palette='4' caption='Bruto inkomen' subcaption='overlijden relatie' xAxisName='jaar' yAxisName='bruto inkomen' numberPrefix='

Share this post


Link to post
Share on other sites

Hi,

I have tried your code in a php file and its working properly...

<HTML>

<HEAD>

<script type="text/javascript" language="javascript" src="FusionCharts.js"></script>

</HEAD>

<body>

<?php

include("FusionCharts.php");

 $strXML="<chart palette='4' caption='Bruto inkomen' subcaption='overlijden relatie' xAxisName='jaar' yAxisName='bruto inkomen' numberPrefix='

Share this post


Link to post
Share on other sites

this is the complete code:

<?php
//You need to include the following JS file, if you intend to embed the chart using JavaScript.
//Embedding using JavaScripts avoids the "Click to Activate..." issue in Internet Explorer
//When you make your own charts, make sure that the path to this JS file is correct. Else, you would get JavaScript errors.

session_start();
include("../Fusions/Code/PHP/Includes/FusionCharts.php");
?> 
<SCRIPT LANGUAGE="Javascript" SRC="../Fusions/JSClass/FusionCharts.js"></SCRIPT>
<?

$strXML = "&ltchart palette='4' caption='Bruto inkomen' subcaption='overlijden relatie' xAxisName='jaar' yAxisName='bruto inkomen' numberPrefix='x' showValues='0' decimals='0' &gt";



$strCategories = "&ltcategories&gt";

for ($x = 0; $x < $_SESSION['eindgrafiek']; $x++) {
$strCategories.= "&ltcategory name='" . $_SESSION['jaar']['klp_lft'][$x] . "' /&gt";
}
$strCategories .= "&lt/categories&gt";

//renderAs='Area'
$strDataset1 = "&ltdataset seriesName='Norm' &gt";
for ($x = 0; $x < $_SESSION['eindgrafiek']; $x++) {
$strDataset1.= "&ltset value='" . $_SESSION['jaar']['norm'][$x] . "' /&gt";
}
$strDataset1 .= "&lt/dataset&gt";

$strDataset2 = "&ltdataset seriesName='Bruto'&gt";
for ($x = 0; $x < $_SESSION['eindgrafiek']; $x++) {
$strDataset2.= "&ltset value='" . $_SESSION['jaar']['jaarx'][$x] . "' /&gt";
}
$strDataset2 .= "&lt/dataset&gt";
$strXML .= $strCategories . $strDataset1 . $strDataset2 . "&lt/chart&gt";
?><br><br><br>
[b][i] [/b][/i];[b][i] [/b][/i];[b][i] [/b][/i];[b][i] [/b][/i];[b][i] [/b][/i];[b][i] [/b][/i];

<?
//echo $strXML;
// in de produktieversie?
echo renderChart("MSCombi2D.swf","",$strXML, "productSales", 600, 300, true, false);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this