Developed with love by KnpLabs Hire us for your project!
33

SaadTaziGChartBundle

by saadtazi

Google Chart Bundle for Symfony2

What is it?

This is a super simple Bundle that facilitate the usage of Google Chart Tool, Google Chart Image API and Google Infographics.

It allows to render:

  • QRCode
  • Pie Chart (3 ways: canvas or svg, simple image from url, simple 3d image from url)
  • Column Chart
  • Bar Chart
  • Area Chart
  • scatter Chart
  • Combo Chart
  • Table
  • Gauge
  • Candlestick Chart
  • Map tree
  • Dynamic Icons

Make sure you read the Chart Image terms and Chart tool terms before using that bundle.

It also contains some Twig extension that facilitates the integration.

Demo

http://blog.fruitsoftware.com/a-propos/demo-gchartbundle/

How to install it?

Thanks to AaronDDM, you can use
composer to instlall the bundle.
Or you can use the following method:

  1. Add this bundle to your vendor/ dir:

    • Using the vendors script.

      Add the following lines in your deps file:

      [SaadTaziGChartBundle]
          git=git://github.com/saadtazi/SaadTaziGChartBundle.git
          target=/bundles/SaadTazi/GChartBundle
      

      Run the vendors script:

      ./bin/vendors install
      
  * Using git submodules.

        $ git submodule add git://github.com/saadtazi/SaadTaziGChartBundle.git vendor/bundles/SaadTazi/GChartBundle
  1. Add the SaadTazi namespace to your autoloader:

          // app/autoload.php
          $loader->registerNamespaces(array(
                'SaadTazi' => __DIR__.'/../vendor/bundles',
                // your other namespaces
          ));
  1. Add this bundle to your application's kernel:

          // app/ApplicationKernel.php
          public function registerBundles()
          {
              return array(
                  // ...
                  new SaadTazi\GChartBundle\SaadTaziGChartBundle(),
                  // ...
              );
          }

Optional: If you want to see the demo page, add the following to your routing.yml (requires Twig):

    _demo:
        resource: "@SaadTaziGChartBundle/Resources/config/routing.yml"
        type:     yaml
        prefix:   /gchart

Then you should be able to go to http://your.site.com/gchart/demo

Don't forget to include the required javascript in your layout, for example:

        <script type="text/javascript">
            // adds the package you need
            google.load("visualization", "1", {packages:["corechart", 'table', 'gauge']});
        </script> 

How to use it?

Mmm, please check the Controller\DemoController to see how to build DataTable,
and Resources\views\Demo\demo.html.twig

Notes

I implemented almost all the corechart chart types from the Google Chart Tool.
But I only implemented 3 Google Chart Image types, because
(they are ugly and) almost all of them can be built using
the Google Chart Tool.
From the Visualization, I only implemented the marker.

Ohh, please feel free to fork, add to it and send me pull requests!

Note: You don't have to use the Twig functions: you can use the php classes (in DataTable and or in Chart).
But you will probably find it a little bit "painful".

Mods

2012-03-20

  • added composer support (thanks to AaronDDM)

2011-10-23

  • removed jQuery dependency (and div output - needs to be done "manually" now... Provides more control)

2011-09-22

  • zero value bug fix

2011-09-06

  • Added DataTable::toStrictArray() that checks array keys (ticket #1)

2011-06-23

  • Initial commit
The MIT License (MIT)

Copyright (c) 2013 Saad Tazi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • added LICENSE file
    By saadtazi, 4 years ago
  • adding MIT license to composer.json
    By saadtazi, 4 years ago
  • Merge pull request #6 from wolfish/patch-1
    By saadtazi, 4 years ago
  • Changed session.flash to new session.flashbag
    By wolfish, 4 years ago
  • Merge branch 'master' of github.com:saadtazi/SaadTaziGChartBundle
    By saadtazi, 5 years ago
  • fixed date handling
    By saadtazi, 5 years ago
  • added info about composer
    By saadtazi, 5 years ago
  • added back the symfony "require" info
    By saadtazi, 5 years ago
  • updated the demo template
    By saadtazi, 5 years ago
  • Update composer.json
    By saadtazi, 5 years ago
  • Merge pull request #4 from AaronDDM/master
    By saadtazi, 5 years ago
  • Added a composer.json entry for this bundle
    By AaronDDM, 5 years ago
  • removed jquery dependency and the div output: provides more control, less majic, and allows to have jQuery loaded at the bottom of the page
    By saadtazi, 6 years ago
  • Merge branch 'master' of github.com:saadtazi/SaadTaziGChartBundle
    By saadtazi, 6 years ago
  • added pins (visualization), added MapTree and CandleStick (Chart tools)
    By saadtazi, 6 years ago
  • Merge pull request #3 from abixmedia/master
    By saadtazi, 6 years ago
  • fixed wrong path in readme
    By haet, 6 years ago
  • readme modification (C&P error)
    By saadtazi, 6 years ago
  • fix: invalid test classname - was causing 'No tests found in class "Symfony\Bundle\FrameworkBundle\Tests\TestCase".'
    By saadtazi, 6 years ago
  • Added
    By saadtazi, 6 years ago
  • Added
    By saadtazi, 6 years ago
  • better fix for the zero value bug
    By saadtazi, 6 years ago
  • fixed zero value issue (ticket #2)
    By saadtazi, 6 years ago
  • added the ability to retrieve DataTable strict array (matches column ids)
    By saadtazi, 6 years ago
  • Edited README.md via GitHub
    By saadtazi, 6 years ago
  • Edited README.md via GitHub
    By saadtazi, 6 years ago
  • modified README.md
    By saadtazi, 6 years ago
  • modified README.md
    By saadtazi, 6 years ago
  • modified README.md
    By saadtazi, 6 years ago
  • modified README.md
    By saadtazi, 6 years ago