2017 © Pedro Peláez
 

library lavacharts

PHP wrapper library for the Google Chart API

image

khill/lavacharts

PHP wrapper library for the Google Chart API

  • Thursday, July 26, 2018
  • by kevinkhill
  • Repository
  • 22 Watchers
  • 438 Stars
  • 296,787 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 116 Forks
  • 17 Open issues
  • 65 Versions
  • 8 % Grown

The README.md

Lavacharts 3.1.12

Total Downloads License Minimum PHP Version Gitter PayPal, (*1)

Lavacharts is a graphing / chart library for PHP5.4+ that wraps the Google Chart API., (*2)

Stable: Current Release Build Status Coverage Status, (*3)

Dev: Development Release Build Status Coverage Status, (*4)

Developer Note

Please don't be discouraged if you see that it has been "years" since an update, but rather think that Lavacharts has settled into a "stable" state and requires less tinkering from me. I would love to add new features, but my responsibilities leave little room for my projects. I am happy to field issues, answer questions, debug and help if needed. Lavacharts is not vaporware! :smile:, (*5)

Package Features

  • Updated! Laravel 5.5+ auto-discovery
  • Any option for customizing charts that Google supports, Lavacharts should as well. Just use the chart constructor to assign any customization options you wish!
  • Custom JavaScript module for interacting with charts client-side
    • AJAX data reloading
    • Fetching charts
    • Events integration
  • Column Formatters & Roles
  • Blade template extensions for Laravel
  • Twig template extensions for Symfony
  • Carbon support for date/datetime/timeofday columns
  • Now supporting 22 Charts!
    • Annotation, Area, Bar, Bubble, Calendar, Candlestick, Column, Combo, Gantt, Gauge, Geo, Histogram, Line, Org, Pie, Sankey, Scatter, SteppedArea, Table, Timeline, TreeMap, and WordTree!

For complete documentation, please visit lavacharts.com

Upgrade guide: Migrating from 2.5.x to 3.0.x

For contributing, a handy guide can be found here


Installing

In your project's main composer.json file, add this line to the requirements:, (*6)

"khill/lavacharts": "^3.1"

Run Composer to install Lavacharts:, (*7)

$ composer update

Framework Agnostic

If you are using Lavacharts with Silex, Lumen or your own Composer project, that's no problem! Just make sure to: require 'vendor/autoload.php'; within you project and create an instance of Lavacharts: $lava = new Khill\Lavacharts\Lavacharts;, (*8)

Laravel

To integrate Lavacharts into Laravel, a ServiceProvider has been included., (*9)

Laravel ~5.5

Thanks to the fantastic new Package Auto-Discovery feature added in 5.5, you're ready to go, no registration required :+1:, (*10)

Configuration

To modify the default configuration of Lavacharts, datetime formats for datatables or adding your maps api key... Publish the configuration with php artisan vendor:publish --tag=lavacharts, (*11)

Laravel ~5.4

Register Lavacharts in your app by adding these lines to the respective arrays found in config/app.php:, (*12)

 [
    // ...

    Khill\Lavacharts\Laravel\LavachartsServiceProvider::class,
],

// ...
'aliases' => [
    // ...

    'Lava' => Khill\Lavacharts\Laravel\LavachartsFacade::class,
]
```
#### Configuration
To modify the default configuration of Lavacharts, datetime formats for datatables or adding your maps api key...
Publish the configuration with `php artisan vendor:publish --tag=lavacharts`


### Laravel ~4
Register Lavacharts in your app by adding these lines to the respective arrays found in `app/config/app.php`:

```php
 array(
    // ...

    "Khill\Lavacharts\Laravel\LavachartsServiceProvider",
),

// ...
'aliases' => array(
    // ...

    'Lava' => "Khill\Lavacharts\Laravel\LavachartsFacade",
)
```
#### Configuration
To modify the default configuration of Lavacharts, datetime formats for datatables or adding your maps api key...
Publish the configuration with `php artisan config:publish khill/lavacharts`


## Symfony
The package also includes a Bundle for Symfony to enable Lavacharts as a service that can be pulled from the Container.

### Add Bundle
Add the bundle to the registerBundles method in the AppKernel, found at `app/AppKernel.php`:
```php
DataTable();

$data->addDateColumn('Day of Month')
     ->addNumberColumn('Projected')
     ->addNumberColumn('Official');

// Random Data For Example
for ($a = 1; $a addRow($rowData);
}
```

Arrays work for datatables as well...
```php
$data->addColumns([
    ['date', 'Day of Month'],
    ['number', 'Projected'],
    ['number', 'Official']
]);
```

Or you can `use \Khill\Lavacharts\DataTables\DataFactory` [to create DataTables in another way](https://gist.github.com/kevinkhill/0c7c5f6211c7fd8f9658)

#### Chart Options
Customize your chart, with any options found in Google's documentation. Break objects down into arrays and pass to the chart.
```php
$lava->LineChart('Stocks', $data, [
    'title' => 'Stock Market Trends',
    'animation' => [
        'startup' => true,
        'easing' => 'inAndOut'
    ],
    'colors' => ['blue', '#F4C1D8']
]);
```

#### Output ID
The chart will needs to be output into a div on the page, so an html ID for a div is needed.
Here is where you want your chart `
` - If no options for the chart are set, then the third parameter is the id of the output: ```php $lava->LineChart('Stocks', $data, 'stocks-div'); ``` - If there are options set for the chart, then the id may be included in the options: ```php $lava->LineChart('Stocks', $data, [ 'elementId' => 'stocks-div' 'title' => 'Stock Market Trends' ]); ``` - The 4th parameter will also work: ```php $lava->LineChart('Stocks', $data, [ 'title' => 'Stock Market Trends' ], 'stocks-div'); ``` ## View Pass the main Lavacharts instance to the view, because all of the defined charts are stored within, and render! ```php = $lava->render('LineChart', 'Stocks', 'stocks-div'); ?>

Or if you have multiple charts, you can condense theh view code withL, (*13)

<?= $lava->renderAll(); ?>

Changelog

The complete changelog can be found here, (*14)

Stargazers over time

Stargazers over time, (*15)

The Versions

26/07 2018

3.1.x-dev

3.1.9999999.9999999-dev http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

by MicahKV

laravel symfony google charts graphs

26/07 2018

3.1.11

3.1.11.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel symfony google charts graphs

10/05 2018

3.1.10

3.1.10.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel symfony google charts graphs

23/01 2018

dev-dates

dev-dates http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel symfony google charts graphs

17/11 2017
01/11 2017

3.1.9

3.1.9.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel symfony google charts graphs

06/07 2017

3.2.x-dev

3.2.9999999.9999999-dev http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel symfony google charts angular graphs

29/05 2017

dev-3.1-dev

dev-3.1-dev http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel symfony google charts graphs

18/02 2016

2.5.x-dev

2.5.9999999.9999999-dev http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

google charts graphs

12/02 2016
22/01 2016
20/02 2015

2.0.5

2.0.5.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

google charts graphs

17/01 2015

2.0.4

2.0.4.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

google charts graphs

01/01 2015

2.0.3

2.0.3.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

google charts graphs

23/12 2014

2.0.2

2.0.2.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

google charts graphs

22/12 2014

2.0.1

2.0.1.0 http://lavacharts.com

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

 

The Development Requires

google charts graphs

14/07 2014

1.0.0

1.0.0.0 http://kevinkhill.github.io/LavaCharts

PHP wrapper library for the Google Chart API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

composer google packagist charts graphs