FusionCharts - API
http://www.fusioncharts.com/
PHPClasses
Description
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.
Requirement
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
Install
composer require deoliveiralucas/fusion-charts-api
Example
Columnsuse FusionChartsChartColumnLine; use FusionChartsTagCategories; use FusionChartsTagCategory; use FusionChartsTagDataSet as Columns; use FusionChartsTagSet 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); $categories->addCategory($category); } $columns = new Columns(); foreach ($values as $value) { $column = new Column($value); $columns->addSet($column); } $chart ->setName('Chart Columns Example') ->setWidth(800) ->setHeight(400) ->setLabelRotate(true) ->setXdescription('x values') ->setYdescription('y values') ->setAttribute('showyaxisvalues', '0') ->addCategories($categories) ->addColumns($columns); // 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.
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。