2017 © Pedro PelĂĄez
 

symfony-bundle amcharts-bundle

Symfony2 Bundle that ease the use of AmCharts to display rich graph and charts in your app

image

rcousens/amcharts-bundle

Symfony2 Bundle that ease the use of AmCharts to display rich graph and charts in your app

  • Tuesday, March 28, 2017
  • by rcousens
  • Repository
  • 1 Watchers
  • 3 Stars
  • 6,956 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

RCAmChartsBundle

RCAmChartsBundle eases the use of AmCharts to display rich graph and charts in your Symfony2 application by providing Twig extensions and PHP objects to do the heavy lifting. The bundle incorporates the JS charting library AmCharts., (*1)

DRY out your chart code by writing it all in PHP!, (*2)

Content

License

RCAmChartsBundle is released under the MIT License. See the bundled LICENSE file for details., (*3)

Please note that the AmCharts JS library bundled with the project is free for commercial use provided you retain the advertisement., (*4)

How to get started

Installation

  1. Add the following to your composer.json file, (*5)

       "require": {
           ...
           "rcousens/amcharts-bundle": "dev-master@dev"
           ...
       }
    
  2. Run php composer.phar update "rcousens/amcharts-bundle", (*6)

  3. Register the bundle in your app/AppKernel.php:, (*7)

    php <?php ... public function registerBundles() { $bundles = array( ... new RC\AmChartsBundle\RCAmChartsBundle(), ... ); ..., (*8)

  4. Install the static assets, (*9)

    php app/console assets:install --symlink web
    

Usage

Basic Pie Chart

In your controller ..., (*10)

``` php <?php use RC\AmChartsBundle\AmCharts\AmPieChart;, (*11)

// ...
public function chartAction()
{
    // Chart
    $pieChart = new \RC\AmChartsBundle\AmCharts\AmPieChart();

    $pieChart->renderTo('piechart');
    $pieChart->setTitleField('number');
    $pieChart->setValueField('column-1');
    $pieChart->addData(array('number' => '1', 'column-1' => 10));
    $pieChart->addData(array('number' => '2', 'column-1' => 40));
    $pieChart->addData(array('number' => '3', 'column-1' => 30));

    return $this->render('::template.html.twig', array(
        'chart' => $chart
    ));
}

In your template ... ``` html

VoilĂ  !, (*12)

The Versions

28/03 2017

dev-master

9999999-dev https://github.com/rcousens/AmChartsBundle

Symfony2 Bundle that ease the use of AmCharts to display rich graph and charts in your app

  Sources   Download

MIT

The Requires

 

by Ross Cousens

symfony2 chart graph charts amcharts graphs charting

21/07 2014

v1.0.0

1.0.0.0 https://github.com/rcousens/AmChartsBundle

Symfony2 Bundle that ease the use of AmCharts to display rich graph and charts in your app

  Sources   Download

MIT

The Requires

 

by Ross Cousens

symfony2 chart graph charts amcharts graphs charting