Advantages of Fusioncharts Over Open Source Libraries

This php chart article about, Why should you use FusionCharts rather than open-source libraries?, There are many open-source chart libraries available, but not all of the chart have capabilities to construct a successful application dashboard.

The FusionCharts is a JavaScript charting library that enables you to create interactive charts, gauges, maps and dashboards in JavaScript.You can create interactive charts for desktop as well as for mobile devices.

They are providing all the variations of popular charts like Bar, Column, Line, Area, and Pie; or domain-specific charts like Treemaps, Heatmaps, Gantt Charts, Marimekko Charts, Gauges, Spider Charts, Waterfall Charts, and many more!, it has around 100+ Interactive Charts & 2,000+ Data-driven Maps which cover countries, counties and even cities!.

Fusioncharts also offers a free version of the libs, although there are some restrictions and each chart comes with a watermark.

What Benefit You will get over Free Chart Libs

You will get following benefit over open source Chart libarray:

  • No Water mark or link over chart.
  • You can access around 100+ Interactive Charts.
  • You can have complete control over our chart’s attributes and characteristics.
  • There are 2,000+ Data-driven Maps available for you project.
  • The premium customer support for issues.
  • The Pre-Requisite

    For fusion charts, the following prerequisites must be met:

    • PHP 5.6 or higher
    • Installed XAMPP into local system
    • Download libs from Here
    • .

    Fusion Chart Example With PHP

    They’ve created a basic FusionCharts server-side PHP wrapper. Any PHP project can benefit from the FusionCharts server-side PHP wrapper, which allows you to simply add rich and interactive charts. You can generate charts in your browsers without creating any JavaScript code by using the wrapper.

    Install fusion chart

    Let’s install FusionCharts and use the FusionCharts server-side PHP wrapper to render a chart. We must first download and extract the zip file.

    Make Your Own Project

    Create a project under the XAMPP installation. Create a new empty directory (PHP fusioncharts) for your project under XAMPP/htdocs.

    Create a project structure for Fusion

    For this sample chart example, let’s construct the following folder structure:

    • Inside the xampp/htdocs/PHPfusioncharts directory, create a new directory called fusioncharts.
    • Within the xampp/htdocs/PHPfusioncharts directory, create libs/fusioncharts directories.
    • Created a index.php file inside xampp/htdocs/PHPfusioncharts directory.

    Let’s Copy the php-fusioncharts wrapper which was downloaded from Here (fusioncharts-suite-xt/integrations/php/fusioncharts-wrapper) to the newly created folder (xampp/htdocs/PHPfusioncharts/libs/fusioncharts).

    Copy the js directory which contains all the javascript files fusioncharts-suite-xt/js into PHPfusioncharts/resources.

    Preparing Data

    Now that we’ve generated some sample data for the 2D chart, We’ll construct some task status and represent them in the 2D chart.

    SNStatus>No of Tasks
    1.Completed20
    2.Pending40
    3.InProgress10
    4.Backlog05

    FusionCharts accepts the data in JSON format, So, we first add the data in index.php file and then convert it into the JSON format.

    The Data Structure:

    Include Chart Library

    To apply a style to the chart, we’ll first add the Fusioncharts JavaScript files under the head section of index.php file.

    Chart Container

    Create HTML div for chart container, that holds chart UI.

    Define Chart Attributes

    Add the chart attributes in the index.php file. FusionCharts accepts data in JSON format, so we convert these attributes into JSON format.

    Create Fusion Chart Using Json Data

    Let’s create a Column 2D Chart using the php-fusioncharts wrapper showing “Tasks Status”.Let’s add the below code into the index.php file, which will have the chart constructor, attributes, and the datasource required to render the chart.

    The consolidated code is shown below:

    Conclusion:

    We learned about the capabilities of fusion charts here, and how the license version of fusioncharts has more functionality than the free version. We also created a 2D chart for task status. You might look into other chart possibilities.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.