How to integrate the Fusioncharts library with Drupal 7? I have been trying to integrate the Fusioncharts library with my Drupal 7 site.

Just to check if everything is working properly, I followed this documentation for creating a basic graph with data contained in Data.xml file; the entire documentation is here.

FYI, I need to use PHP as I am more comfortable with it.

I have extracted the downloaded folder into /sites/all/libraries/FusionChartsFree/; with changes in paths (nothing else); I have pasted the code in the given example into my Drupal 7 node with the php input filter enabled. I also have the libraries module installed.

&lt;?php
  //We've included ../Includes/FusionCharts_Gen.php, which contains FusionCharts PHP Class
  //to help us easily embed the charts.
  $name = "FusionChartsFree";
  if ($path = libraries_get_path($name)) {
    include $path . '/Code/PHP/Includes/FusionCharts.php';
  }
?&gt;
&lt;html&gt;
  &lt;head&gt;      
    &lt;?php
      //You need to include the following JS file, if you intend to embed the chart using JavaScript.
      //When you make your own charts, make sure that the path to this JS file is correct. Else, you
      //would get JavaScript errors.

      include($path.'/Code/FusionCharts/FusionCharts.js');
    ?&gt; 
    &lt;script type="Javascript" SRC="/sites/all/libraries/FusionChartsFree/Code/FusionCharts/FusionCharts.js"&gt;&lt;/SCRIPT&gt;
    &lt;title&gt;FusionCharts - Simple Column 3D Chart&lt;/title&gt; 
  &lt;/head&gt;
  &lt;body&gt;
    &lt;?php
      //Create the chart - Column 3D Chart with data from Data/Data.xml
      echo renderChart("/sites/all/libraries/FusionChartsFree/Code/FusionCharts/Column3D.swf", "/sites/all/libraries/FusionChartsFree/Code/PHP/BasicExample/Data/Data.xml", "", "myFirst", 600, 300, false, true); 
   ?&gt;
  &lt;/body&gt;
&lt;/html&gt;


I get the below output. It is pretty long; hence, I have put then in part by part in these pictures.











(FYI, those Flash files that appear in the output, do not display anything if I click on them.)

Now, suppose I remove the below line from the code.

&lt;?php
 include $path . '/Code/FusionCharts/FusionCharts.js';
?&gt;


I get nothing. I mean only a text which reads "cahrt" in the below output.



My Question: How can I make Fusioncharts work in DRUPAL 7?

I am also having similar trouble with the pChart library too: Even pChart does not display anything, not even an error, or warning. Simply there is nothing in the node body.
There's a couple of problems in your code:


include($path.'/Code/PHP/Includes/FusionCharts.php'); you have to use ./ to include files.
include($path.'/Code/FusionCharts/FusionCharts.js'); you should use drupal_add_js() to include javascript in your code.
FusionCharts documentation seems a little old as Column3D.swf is now FCF_Column3D.swf


Here is a working example, I haven't used the librarie module but you should be able to adapt it easily. I put this code in a node with PHP filter activated.

&lt;?php
$file = './sites/all/libraries/FusionChartsFree/Code/PHP/Includes/FusionCharts.php';
if (is_file($file)) {
  require_once $file;
}
drupal_add_js('sites/all/libraries/FusionChartsFree/Code/FusionCharts/FusionCharts.js');

//Create the chart - Column 3D Chart with data from Data/Data.xml
echo renderChart("/sites/all/libraries/FusionChartsFree/Code/FusionCharts/FCF_Column3D.swf", "/sites/all/libraries/FusionChartsFree/Code/PHP/BasicExample/Data/Data.xml", "", "myFirst", 600, 300, false, true); 

?&gt;