PHP Classes


Recommend this page to a friend!
  Classes of Lucas de Oliveira  >  FusionCharts PHP Class API  >  >  Download  
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: FusionCharts PHP Class API
Generate graphical charts using FusionCharts API
Author: By
Last change: Update
refactor code, add namespaces and fix psr2
Date: 4 years ago
Size: 2,485 bytes


Class file image Download

FusionCharts - API




This package can provide the data to generate graphical charts using the FusionCharts Library.

It provides a base class that can generate JSON for rendering several types of charts supported by the FusionCharts taking XML code that defines the parameters of the charts.

The package comes also with specialized classes that can generate the necessary XML code with the parameters for several types of charts.

Currently it comes with classes for rendering charts of types column, line, plot, pie and pareto.

The chart classes provide a fluent interface to define any of the supported parameters like the chart data values, chart size, colors, labels, fonts, and other chart specific parameters.


  • PHP 5.3 >
  • Download the FusionCharts Javascript library in the oficial website
  • Import these two files to your HTML page: fusioncharts.charts.js and fusioncharts.js


composer require deoliveiralucas/fusion-charts-api


  • Columns
    use FusionCharts\Chart\ColumnLine;
    use FusionCharts\Tag\Categories;
    use FusionCharts\Tag\Category;
    use FusionCharts\Tag\DataSet as Columns;
    use FusionCharts\Tag\Set as Column;

// Data from db $months = array('Jan', 'Feb', 'Mar', 'Apr'); $values = array(100, 200, 150, 210);

$chart = new ColumnLine('chart-container');

$categories = new Categories(); foreach ($months as $month) {

$category = new Category($month);


$columns = new Columns(); foreach ($values as $value) {

$column = new Column($value);



->setName('Chart Columns Example')
->setXdescription('x values')
->setYdescription('y values')
->setAttribute('showyaxisvalues', '0')

// render chart in the index.php

- Please see EXAMPLES for details.

## Contributing ##

- Please see CONTRIBUTING for details.

## License

- GNU General Public License Versions. Please see License File for more information.
For more information send a message to info at phpclasses dot org.