PHP Module for FusionCharts

Add interactive charts to your website using our PHP wrapper

The FusionCharts PHP server-side wrapper lets you create charts in your PHP website without writing any JavaScript code.

Features

  • Enjoy support for key FusionCharts features like annotations, macros, themes, image-export, and more.
  • Execute your projects without writing separate API for your JavaScript application.
  • SQL or NoSQL, connect your chart directly to database of your choice
  • Add data in multiple ways, JSON or XML.

Quick Demo

Simple chart
Quick demo

Quick Start

Step 1 : Install the FusionCharts PHP Module

  • Unzip the archive and move to fusioncharts-suite-xt > integrations > php > fusioncharts-wrapper to get the fusioncharts.php file.
  • Copy this file to your project folder.
  • Start using the methods and classes available under the FusionCharts namespace to generate charts in your project.

Step 2 : Install FusionCharts JavaScript library

Install FusionCharts JavaScript library in your page where you want to display FusionCharts. Download FusionCharts and add it in your project

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

Step 3 : Add FusionCharts module in your PHP page

include("fusioncharts.php");

Step 3 : Render your chart

For example, render a simple column chart

$columnChart = new FusionCharts(
            "column2d", 
            "ex1" , 
            "600", 
            "400", 
            "chart-1", 
            "json", 
            '{  
               "chart":
               {  
                  "caption":"Harry\'s SuperMart",
                  "subCaption":"Top 5 stores in last month by revenue",
                  "numberPrefix":"$",
                  "theme":"ocean"
               },
               "data":
               [  
                  {  
                     "label":"Bakersfield Central",
                     "value":"880000"
                  },
                  {  
                     "label":"Garden Groove harbour",
                     "value":"730000"
                  },
                  {  
                     "label":"Los Angeles Topanga",
                     "value":"590000"
                  },
                  {  
                     "label":"Compton-Rancho Dom",
                     "value":"520000"
                  },
                  {  
                     "label":"Daly City Serramonte",
                     "value":"330000"
                  }
               ]
        });

Add a container div

<div id="chart1"></div>

and Render the chart

$columnChart->render();

Licensing

FusionCharts PHP module is open-source and distributed under the terms of the MIT/X11 License. You will still need to download and include FusionCharts in your page. This project provides no direct functionality. You can download a free evaluation version. However, You will need to purchase a FusionCharts license to use in a commercial environment (FusionCharts is free for non-commercial and personal use).