Sign in to follow this  
Sno

MSLine2D not rendering

Recommended Posts

Hi everybody,

 

I try to render a multi series line chart in my page, using 3 php files :

- index.php, wich contains a form to pick up some elements (processes executed in the month, and a period -last hour, last day..),

- processCharts.php, which treat the informations from the form and call the function "renderchartAvgSum(()"

- chartCreation.php, in which i defined the function "renderchartAvgSum()" and which uses "renderChartJS()" from FusionChart. let's see this :

 

chartCreation.php

<?php
require_once("/FusionChartPath/FusionCharts_Gen.php");

/* function renderchartAvgSum() :
 * $chartType : the Chart we  want to build. MSLine, Line etc...
 * $pID : lists of process Ids to find in the database
 * $step : step of xAxis in the cahrt
 * $diffDate : difference in days between $endDate -today- and begin date of process
 * $endDate : ending date of process . generally = SYSDATE
 * $queryValue : what we need (avg by wich time?)
 * $graphW, $graphH : dimensions of chart.
*/
renderchartAvgSum($chartType,$pID,$step, $diffDate, $endDate, $chartName, $queryValue, $graphW, $graphH){
if(!empty($processList)){

}
?>

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Could you please provide the "renderchartAvgSum()" function code snippet of how you are generating the chart?

 

Also, please provide the XML data generated by FusionCharts PHP wrapper Class (from the browser developer tool > Net tab), so that we can look into the exact issue.

 

Awaiting your valuable inputs.

Share this post


Link to post
Share on other sites

Hi Sashbhusan,
I tried to edit this topic and add some code, but, strangely it won't let me edit or delete it...
So, the renderchartAvgSum() works like this :
 

function renderchartAvgSum($chartType,$idList,$step,$beginDate,$endDate,$chartName,$valueQuery,$graphW,$graphH){
    //data query made with $idList, which obtain all the datas from the bases
    //treatment of these datas to form a XML string $strXML

    $FC= new FusionCharts("MSline2D", $graphW, $graphH);
// I wanted to display my charts in HML5/JS, so i used this, but it didn't work, so for now it's in comment $FC->setRenderer('javascript');
echo $FC->renderChartJS("FCroots/FusionCharts_XT_Professional/Charts/".$chartType.".swf", "", $strXML, "", $graphW, $graphH);
}

Here is the xml string i get (but xml formated for here so it is easier to read) :

 

"<chart caption='".$chartName."' step='".$step."'>
    <categories>
         <category label ='20/08/2013 08:52:63'></category>
         <category label ='20/08/2013 09:52:63'></category>
         <category label ='20/08/2013 10:52:63'></category>
    </categories>
    <dataset seriesname = 'myProcess01'>
         <set value = '256'></set>
         <set value = '369'></set>
         <set value = '236'></set>
     </dataset>
     <dataset seriesname = 'myProcess02'>
         <set value = '301'></set>
         <set value = '219'></set>
         <set value = '152'></set>
     </dataset>
</chart

But, finally, while typing this response, i tried it with Firefox, and it ended with an issue due to fusionchart files path. :)
By the way, thanks for your fast reaction! :)

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Glad to hear that you have managed of your own to resolve your issue.

 

Happy FusionCharting. :)

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