Development

sfAmChartsPlugin

You must first sign up to be able to contribute.

sfAmCharts - Plugin for using the amCharts package

Author

Alon Noy

Overview

The plugin integrates amCharts http://www.amcharts.com into the symfony php framework. For now, only line chart is implemented.

License

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Compatibility

Was tested against Symfony version 1.0.8

Change log

v1.0.0: First beta release.

Installation

To install the plugin use:

symfony plugin-install http://plugins.symfony-project.com/sfAmChartsPlugin

Settings

You can set your amCharts license key in your application's config/app.yml file like this:

all:
  amcharts_key: AMCHART-XXXX-XXXX-XXXX-XXXX-XXXX

NOTICE: To be able to use the license key with a controller configured to be used with a rewrite rule, add this line to the ".htaccess" file:

RewriteCond %{REQUEST_URI} !\.txt$

Using the plugin

To use the plugin you need to enable the module 'amcharts'. Then you can use the helper like this:

<?php use_helper('AmChart'); ?>

<?php echo line_chart('module/settingsAction', 'module/dataAction', 400, 200, '#FFFFFF', '#000000'); ?>

The 'line_chart' helper accepst the following parameters:

* Internal URI for the chart's settings. (must be a valid XML response)

* Internal URI for the chart's data.(must be valid XML/CSV response)

And the following optional parameters:

* Width (default 400)

* Height (default 200)

* Background color (default #FFFFFF)

* Preloader color (default #000000)

* Flash object ID (default is null which will generate a random id)

* Flash version (default is 8)

This will create a PRINTABLE page with the chart.

Attachments