Lavacharts is a graphing / charting library for PHP 5.4+ that wraps Google's Javascript Chart API.

Overview

Lavacharts 3.1.12

Total Downloads License Minimum PHP Version Gitter PayPal

Lavacharts is a graphing / chart library for PHP5.4+ that wraps the Google Chart API.

Stable: Current Release Build Status Coverage Status

Dev: Development Release Build Status Coverage Status

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! 😄

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!
  • Visit Google's Chart Gallery for details on available options
  • 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:

"khill/lavacharts": "^3.1"

Run Composer to install Lavacharts:

$ 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;

Laravel

To integrate Lavacharts into Laravel, a ServiceProvider has been included.

Laravel ~5.5

Thanks to the fantastic new Package Auto-Discovery feature added in 5.5, you're ready to go, no registration required 👍

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 ~5.4

Register Lavacharts in your app by adding these lines to the respective arrays found in config/app.php:

<?php
// config/app.php

// ...
'providers' => [
    // ...

    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
// app/config/app.php

// ...
'providers' => 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
// app/AppKernel.php

class AppKernel extends Kernel
{
    // ..

    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Khill\Lavacharts\Symfony\Bundle\LavachartsBundle(),
        );
    }
}

Import Config

Add the service definition to the app/config/config.yml file

imports:
  # ...
  - { resource: "@LavachartsBundle/Resources/config/services.yml"

Usage

The creation of charts is separated into two parts: First, within a route or controller, you define the chart, the data table, and the customization of the output.

Second, within a view, you use one line and the library will output all the necessary JavaScript code for you.

Basic Example

Here is an example of the simplest chart you can create: A line chart with one dataset and a title, no configuration.

Controller

Setting up your first chart.

Data

$data = $lava->DataTable();

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

// Random Data For Example
for ($a = 1; $a < 30; $a++) {
    $rowData = [
      "2017-4-$a", rand(800,1000), rand(800,1000)
    ];

    $data->addRow($rowData);
}

Arrays work for datatables as well...

$data->addColumns([
    ['date', 'Day of Month'],
    ['number', 'Projected'],
    ['number', 'Official']
]);

Or you can use \Khill\Lavacharts\DataTables\DataFactory to create DataTables in another way

Chart Options

Customize your chart, with any options found in Google's documentation. Break objects down into arrays and pass to the chart.

$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 <div id="stocks-div"></div>

  • If no options for the chart are set, then the third parameter is the id of the output:
$lava->LineChart('Stocks', $data, 'stocks-div');
  • If there are options set for the chart, then the id may be included in the options:
$lava->LineChart('Stocks', $data, [
    'elementId' => 'stocks-div'
    'title' => 'Stock Market Trends'
]);
  • The 4th parameter will also work:
$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!

<?= $lava->render('LineChart', 'Stocks', 'stocks-div'); ?>

Or if you have multiple charts, you can condense theh view code withL

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

Changelog

The complete changelog can be found here

Stargazers over time

Stargazers over time

Comments
  • TypeError: google.visualization.DataTable is not a constructor

    TypeError: google.visualization.DataTable is not a constructor

    Something seems to be very weird since a couple of days. I randomly get:

    TypeError: google.visualization.DataTable is not a constructor graphs:871:26

    And therefore the Charts won't load. It is totally random, sometimes it works fine, simetimes the error occurres.

    Warm regards!

    bug 
    opened by TheTechnoMan 73
  • Feature requests

    Feature requests

    Hey,

    there are some things for which I could not see a solution in the docs, please correct me if i missed something. I think that those things might be useful therefore I will write them down and you can decide what you think about them and maybe implement them in future version.

    1. [DONE] Is there a way to check if the requested chart is available, to avoid an exception when trying to display a non existing chart? That should not be the case, but it would be more convenient to display something like "Graph currently unavailable" instead of having to deal with possible exceptions if something goes wrong.

    2. [DONE] Is there a way to load/reload an chart over AJAX? For example when the user presses a button?

    3. [ALREADY IMPLEMENTED] Currently the JavaScript code is placed right where the chart should be displayed. Is this required, or would it be possible to place it at a custom location? I wanted to show an loading overlay until the chart has been rendered, sadly now the JS code for the chart(s) is executed way before the code for the overlay.

    4. Is there a way to define a path where the required assets are stored locally? Currently it loads them from Google, which is not that great if you want to do performance optimizations.

    Those are my ideas/concerns/questions that came up while working with the charts. Maybe there are some more in the future. Besides that, an amazing product. Really happy to found something like that.

    Best regards, Michael

    enhancement 
    opened by TheTechnoMan 48
  • NumberColumn Format Pattern Not Being Applied

    NumberColumn Format Pattern Not Being Applied

    Applies to Lavacharts v3.0. I can't seem to get the number column to be formatted correctly. It appears the javascript is generated sanely, but the result is that the text shown on the line is not formatted correctly?

    screen shot 2015-11-05 at 3 39 48 pm

    Here's the code I'm using:

        $currency = new NumberFormat();
        $currency->pattern('$###,###');
        $currency->negativeColor('red');
        $currency->negativeParens(true);
    
        $revenueDataTable = Lava::DataTable()
            ->addStringColumn('Month')
            ->addNumberColumn('Revenue', $currency);
    
        $revenueLineChart = Lava::LineChart('Revenue', $revenueDataTable, [
            'title' => "Revenue",
            'colors' => ['green'],
            'vAxis' => ['format' => '$###,###'],
        ]);
    
    bug 
    opened by SendDerek 34
  • a.getTime is not a function

    a.getTime is not a function

    What Version? 3.0.8

    Issue

    I'm getting the error: a.getTime is not a function when trying to set the horizontal label values to \DateTime objects. I assume this is the way to do this?

    Controller Code (chart creation code)

    <div id="spreadgraph"><div id="google-visualization-errors-all-1" style="display: block; padding-top: 2px;"><div id="google-visualization-errors-0" style="font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 0.8em; line-height: normal; font-family: arial, sans-serif; margin-bottom: 5px;"><span style="background-color: rgb(192, 0, 0); color: white; padding: 2px;">a.getTime is not a function<span style="font-size: 1.1em; font-weight: bold; cursor: pointer; padding-left: 10px; color: black; text-align: right; vertical-align: top;">×</span></span></div></div><div style="position: relative;"><div dir="ltr" style="position: relative; width: 1200px; height: 800px;"><div style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"></div></div><div aria-hidden="true" style="display: none; position: absolute; top: 810px; left: 1210px; white-space: nowrap; font-family: Arial; font-size: 16px; font-weight: bold;"></div><div></div></div></div>
    

    View Code

    				$spreadlines = Lava::DataTable();
    				$spreadlines->addDateTimeColumn('Timestamp')
    							->addNumberColumn('Spread')
    							->addRoleColumn('string', 'tooltip');
    				$spreads = collect([Carbon::now()]);		
    				$spreads->each(function($l) use($spreadlines) {
    					$spreadlines->addRow([$l, -4.5, 'TODO:']);
    				});			
    				$period = new Period( new \DateTime('2018-01-21 11:00:00'), new \DateTime('2018-01-21 14:00:00'));
    				$hTicks = [];
    				foreach ($period->getDatePeriod('1 HOUR') as $immutable) {	
    					$datetime = new \DateTime($immutable->format(\DateTime::ATOM));
    					$hTicks[] = [ 'v' => $datetime ];				
                                    }
    								
    				$linechart = Lava::LineChart('Spread', $spreadlines,
    					[
    						'title' => 'Spread Graph',						
    						'height' =>  800,
    						'width' => 1200,	
    						'vAxis'  => [
    							'textStyle' => ['color' => '#666'],	
    							'ticks' => [ ['v' => -4.0, 'f' => 'TT-4.0'], [ 'v' => -4.05, 'f' => '-115'], [ 'v' => -4.1, 'f' => '-120'], [ 'v' => -4.15, 'f' => '-125'], [ 'v' => -4.2, 'f' => '-130'], [ 'v' => -4.25, 'f' => '+115'], [ 'v' => -4.3, 'f' => '+110'],[ 'v' => -4.35, 'f' => '+105'], [ 'v' => -4.4, 'f' => '+100'], [ 'v' => -4.45, 'f' => '-105'], [ 'v' => -4.5, 'f' => 'TT-4.5'], [ 'v' => -4.55, 'f' => '-115'], [ 'v' => -4.6, 'f' => '-120'], [ 'v' => -4.65, 'f' => '-125'], [ 'v' => -4.7, 'f' => '-130'], [ 'v' => -4.75, 'f' => '+115'], [ 'v' => -4.8, 'f' => '+110'],[ 'v' => -4.85, 'f' => '+105'], [ 'v' => -4.9, 'f' => '+100'], [ 'v' => -4.95, 'f' => '-105'], [ 'v' => -5.0, 'f' => 'TT-5.0']],
    							'textStyle' => ['fontSize' => 10],
    						],
    						'hAxis' => [							
    							'ticks' => $hTicks
    						],	
    						'events' => [
    							'ready' => 'chartReady'
    						],
    					]
    				);
    			}
    
    
    opened by jmichaelterenin 28
  • Problem with ajax

    Problem with ajax

    hi, problem with ajax

    TypeError: lava.loadData is not a function lava.loadData('Chart1', dataTableJson, function (chart) {

    //routes.php
    Route::get('googleAjax', function(){
    
    $lava = new Lavacharts;
    
    $temps = $lava->DataTable('America/Los_Angeles');
    
    $temps->addDateColumn('Date')
          ->addNumberColumn('Max Temp')
          ->addNumberColumn('Mean Temp')
          ->addNumberColumn('Min Temp');
    
    foreach(range(1, 30) as $day) {
        $temps->addRow(array(
            '2014-10-'.$day,
            rand(50,90),
            rand(50,90),
            rand(50,90)
        ));
    }
    
    return $temps->toJson();
    
    });
    
    //test.blade.php
    <script src="{{ asset('/js/jquery-2.1.3.min.js') }}" type="text/javascript"></script>
    <script type="text/javascript">
    
    $(document).ready(function() {  
      $(document).ready(function() {
    
    
        $.getJSON('http://localhost/bitacorasGraficas/public/googleAjax', function (dataTableJson) {
      lava.loadData('Chart1', dataTableJson, function (chart) {
        console.log(chart);
      });
    });
    });
    });
    </script>
    
    bug 
    opened by montes2012 26
  • Lavachart to image

    Lavachart to image

    I am using version 3.0

    Is it possible to export the chart as image file? I tried your solution but the getImageURI() is not working. Can you please give me a working example on this?

    Thanks

    enhancement question 
    opened by emmanuelLS 25
  • Gantt Chart implementation

    Gantt Chart implementation

    Hello

    I am currently looking for a way to integrate a gantt chart into my laravel website, but can't seem to find one with LavaCharts.

    I can see that it is supported on the git over here and can see the class as well, but on the site (http://lavacharts.com) I can't seem to find any example code on which parameters to give along with the object when creating it. With the basic charts, for example a PieChart I can find this on the site and I have no problems creating a piechart or linechart since I know which parameters to give when doing: $pieChart = $lava->PieChart('Donuts', $datatable, [ // parameters ]);

    Could be that I am missing something obvious and the parameters are declared somewhere in the code...

    opened by verhelsttroy 22
  • CalendarChart does not load and causes chrome tab to lock up?

    CalendarChart does not load and causes chrome tab to lock up?

    Hello, I must be doing something wrong but I can't seem to get the calendar chart to work from a blade. I create the date and count columns and rows and can use a bar chart to plot these with and that all works great. If I then change to using a calendarchart chrome will not load the page. I'm using the charts in a tab, all of my other charts load OK, except when I use the calendarchart?

    ...any ideas?

       $dataTable = \Lava::DataTable();
       $dataTable->addDateColumn( 'Date' )->addNumberColumn( 'Count' );
       $dataTable->addRow([ $row->date, $row->count ]);
       $graphic = \Lava::CalendarChart('EventsByHeatmap', $dataTable);
    
        <div id="tab7" class="tab-pane fad">
           <h3>Events Heatmap (raw count)</h3>
           <div id="EventsHeatmap">
           </div>
           @calendarchart('EventsByHeatmap','EventsHeatmap')
        </div>
    
    bug 
    opened by colford 19
  • Chart binding label is hard coded in JavascriptFactory.php

    Chart binding label is hard coded in JavascriptFactory.php

    Currently the dashboard only works if you pass the binding label as 'MyPie' in the controller because that label is hard coded in JavascriptFactory.php around line 292:

    $boundChart = $dashboard->getBinding('MyPie')->getChartWrapper()->getChart();

    I'm currently getting around this issue by calling getBindings() and pulling the label from the first result. I'm sure there's a better way to do this but it works:

    $allBinding = $dashboard->getBindings(); foreach ($allBinding as $thisBinding) { $bindingLabel = $thisBinding->getLabel(); break; } $boundChart = $dashboard->getBinding($bindingLabel)->getChartWrapper()->getChart();

    opened by MicahKV 19
  • Moving Lavacharts to Laravel 5.8 not possible

    Moving Lavacharts to Laravel 5.8 not possible

    What Version?

    3.1.11

    Issue

    Hi all,

    Laravel 5.8 requires Carbon 2.x but Composer's dependency for Lavacharts still stucks in old Carbon 1.x:

    khill/lavacharts 3.1.11 requires nesbot/carbon ~1.14

    So updating my sources with Composer breaks down at this point and as long as Lavacharts doesn't support or permit Carbon 2.x the current library seems not to be usable with Laravel 5.8. I think we need a new major update for Lavacharts supporting Carbon 2.x

    Thanks for your feedback Crazykriz

    opened by Crazykriz 17
  • Support for Traversable and ArrayAccess and other fixes

    Support for Traversable and ArrayAccess and other fixes

    Can you check this progress, I see other stuff that I can change, but I want you to check this.

    Also there is a fix for the Utils::nonEmptyString to allow objects with implemented __toString

    opened by elpiel 17
  • Event is not defined

    Event is not defined

    What Version?

    3.1.14

    Issue

    Uncaught ReferenceError: selectHandler is not defined

    Controller Code (chart creation code)

            \Lava::GeoChart('Province Orders', $provinceOrderDttb, [
                'displayMode' => 'auto',
                'enableRegionInteractivity' => true,
                'keepAspectRatio' => true,
                'region' => 'US',
                'magnifyingGlass' => ['enable' => true, 'zoomFactor' => 7.5], //MagnifyingGlass Options
                'markerOpacity' => 1.0,
                'resolution' => 'provinces',
                'sizeAxis' => null,
                'events' => ['select' => 'selectHandler']
     ]);
    

    View Code

    // I defined it in head tag
    <script>
    [home.txt](https://github.com/kevinkhill/lavacharts/files/8923487/home.txt)
    
            lava.js(function() {
                function selectHandler(event, chart) {
                    console.log('Hi');
                }
            })
    </script>
    
    // Here is render charts which are below script
    <?= \Lava::render('GeoChart', 'Province Orders', 'province-order-chart') ?>
    <?= \Lava::render('PieChart', 'District Orders', 'district-order-chart') ?>
    

    Hope you support it!

    opened by sharhky 0
  • Fix compatibility issues under PHP 8.1, which may cause opcache compilation errors

    Fix compatibility issues under PHP 8.1, which may cause opcache compilation errors

    The JavascriptDate class included in this package has an incompatible constructor with its parent class, Carbon.

    This won't cause issues prior to PHP 8.1 — and is unlikely to even affect those using 8.1 anyway, as the JavascriptDate class doesn't actually seem to be called anywhere in the package :)

    However... If you try to pre-compile your application scripts with the PHP opcache, an E_COMPILE_ERROR is thrown, which can randomly cause your entire autoloader to break 🧨 (as I found out the hard way...). This is due to a PHP bug, which has only recently been fixed (https://github.com/php/php-src/issues/8164)

    A new release tagged as 3.1.15 would be great. Thank you!

    opened by JackWH 1
  • OrgChart.php references trait

    OrgChart.php references trait "PngOutputTrait" instead of "PngRenderableTrait"

    What Version?

    3.1.14

    Issue

    Build an OrgChart. Laravel (8.0) throws error "Trait 'Khill\Lavacharts\Support\Traits\PngOutputTrait' not found"

    Controller Code (chart creation code)

    Normal code. I fixed the problem (see below)
    

    View Code

    khill/lavacharts/src/Charts/OrgChart.php line: 5 references
    
    "use Khill\Lavacharts\Support\Traits\PngOutputTrait as PngRenderable;"
    
    that is unknown. 
    
    

    Solution

    Change line 5 to

    
    "use Khill\Lavacharts\Support\Traits\PngRenderableTrait as PngRenderable;"
    
    

    and all is fine.

    opened by autodidact1958 0
  • Call to undefined method Khill\Lavacharts\DataTables\DataTable::DataTabe()

    Call to undefined method Khill\Lavacharts\DataTables\DataTable::DataTabe()

    What Version?

    versions : * 3.1.14

    Issue

    Call to undefined method Khill\Lavacharts\DataTables\DataTable::DataTabe()

    Controller Code (chart creation code)

    $lava = \Lava::DataTable();
            $studentsCountry = $lava->DataTabe();
    
            $studentsCountry->addStringColumn('Country')
                ->addNumberColumn('Students')
                ->addRow($data);
    
            $lava->GeoChart('studentsPerCountry', $studentsCountry);
    
    opened by majid-al-saidi 0
  • OrgChart is included but not enabled. Why?

    OrgChart is included but not enabled. Why?

    What Version?

    3.1.14

    Issue

    Not sure why OrgChart is not enabled in ChartFactory::$CHART_TYPES = []? I just added it it to the list and it seems to work. Is there a special reason (except missing documentation) why it is excluded from factory?

    Controller Code (chart creation code)

    Here is an example of chart that is working after quick ChartFactory tweak:

            $lava = new Lavacharts; 
    
            $chart = $lava->DataTable();
    
            $chart->addStringColumn('Title')
                ->addStringColumn('Parent')
                ->addStringColumn('Tooltip');
    
            $chart->addRow([['v' => 'Test', 'f' => 'Test<br /> <span class="text-danger">n = 100</span>'], '', 'Some test tooltip']);
            $chart->addRow([['v' => 'Test2', 'f' => 'Test 2<br /> <span class="text-success">n = 50</span>'], 'Test', 'Some test tooltip 2']);
            $chart->addRow([['v' => 'Test3', 'f' => 'Test 3<br /> <span class="text-primary">n = 45</span>'], 'Test', 'Some test tooltip 3']);
    
            $lava->OrgChart('Chart', $chart, [
                    'allowHtml' => true,
                ]);
    

    Thanks!

    bug 
    opened by Dimonka2 1
  • Adding data descriptions on the X axis

    Adding data descriptions on the X axis

    Hi, I am beginner in php. I make my project with Laravel 8. I have this code:

    `$names = []; $data = [''];

        foreach ($items as $item) {
            array_push($names, ['number', $item->item->name . ' [' . $item->item->short_name . '] - '. $item->weight_sum]);
            array_push($data, $item->weight_sum);
        }
    
        $imgItems = \Lava::DataTable();
    
        $imgItems
            ->addStringColumn('Description')
            ->addColumns($names);
    
        $imgItems->addRow($data);
    
        \Lava::ColumnChart('imgitems', $imgItems, [
            'title' => 'Raport',
            'height' => 1000,
            'width' => 2000,
            'legend' => [
                'position' => 'right'
            ],
            'titleTextStyle' => [
                'color' => '#eb6b2c',
                'fontSize' => 14
            ],
            'events' => [
                'ready' => 'getImageCallback'
            ]
        ]);`
    

    In result I have: https://ibb.co/j4ghGL6

    I need to add descriptions under the graph lines as in the screenshot: https://ibb.co/gb0XyMd

    How can I do this?

    Please help

    opened by lukpeta 1
Releases(3.1.14)
  • 3.1.14(Nov 23, 2020)

  • 3.1.13(Sep 9, 2020)

  • 3.1.12(Aug 30, 2019)

  • 3.1.11(Jul 26, 2018)

  • 3.1.10(May 10, 2018)

  • 3.1.9(Nov 1, 2017)

  • 3.1.8(Aug 10, 2017)

  • 3.1.7(Aug 9, 2017)

    Added the tag lavacharts to the config publishing. Use php artisan vendor:publish --tag=lavacharts If that does not work, try to clear the cache with php artisan config:clear and re-publish with --force.

    Source code(tar.gz)
    Source code(zip)
  • 3.1.6(May 30, 2017)

    The event callback within lava.js was modified to pass back the chart and the datatable so users can interact with either during an event. This solves issue #203

    Source code(tar.gz)
    Source code(zip)
  • 3.1.4(May 16, 2017)

  • 3.1.3(Apr 14, 2017)

    • Adding support for date columns to be null which enables support for Gantt charts to have linked sections.
    • Also adding JavascriptDate class which is an (hacky) alias for the Javascript Date object. (I really just wanted to be able to copy and paste Google examples into my tests and DataTables)

    Short Example:

    use Khill\Lavacharts\Support\JavascriptDate as Date;
    
    $daysToMilliseconds = function ($days) {
        return $days * 24 * 60 * 60 * 1000;
    };
    
    $data = $lava->DataTable();
    $data->addColumn('string', 'Task ID');
    $data->addColumn('string', 'Task Name');
    $data->addColumn('date', 'Start Date');
    $data->addColumn('date', 'End Date');
    $data->addColumn('number', 'Duration');
    $data->addColumn('number', 'Percent Complete');
    $data->addColumn('string', 'Dependencies');
    $data->addRows([
        ['Research', 'Find sources',
         new Date(2015, 0, 1), new Date(2015, 0, 5), null,  100,  null],
        ['Write', 'Write paper',
         null, new Date(2015, 0, 9), $daysToMilliseconds(3), 25, 'Research,Outline'],
        ['Cite', 'Create bibliography',
         null, new Date(2015, 0, 7), $daysToMilliseconds(1), 20, 'Research'],
        ['Complete', 'Hand in paper',
         null, new Date(2015, 0, 10), $daysToMilliseconds(1), 0, 'Cite,Write'],
        ['Outline', 'Outline paper',
         null, new Date(2015, 0, 6), $daysToMilliseconds(1), 100, 'Research']
    ]);
    
    Source code(tar.gz)
    Source code(zip)
  • 3.1.2(Apr 12, 2017)

  • 3.1.1(Apr 11, 2017)

  • 3.1.0(Apr 5, 2017)

    I have had this "ready" for months but have procrastinated long enough. I will fix bugs as they arise, but there have been advancements that are worth releasing.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.8(Mar 14, 2017)

    Added support for the 'data' and 'domain' column roles.

    Here is a short example of the usage of the 'domain' role:

    /**
     * Example implementation of the 'domain' column role:
     *
     * @link https://developers.google.com/chart/interactive/docs/roles
     *
     * label: '2009, Quarter', '2009, Sales', '2009, Expenses', '2008,  Quarter', '2008, Sales', '2008, Expenses'
     * role:  domain,   data,       data,   domain,   data,     data
     *       'Q1/09',   1000,        400,  'Q1/08',    800,      300
     *       'Q2/09',   1170,        460,  'Q2/08',    750,      400
     *       'Q3/09',    660,       1120,  'Q3/08',    700,      540
     *       'Q4/09',   1030,        540,  'Q4/08',    820,      620
     *
     */
        use \Khill\Lavacharts\Lavacharts;
    
        $lava = new Lavacharts;
    
        $table = $lava->DataTable();
        $table->addStringColumn('2009, Quarter', null, 'domain')
              ->addNumberColumn('2009, Sales')
              ->addNumberColumn('2009, Expenses')
              ->addStringColumn('2008, Quarter', null, 'domain')
              ->addNumberColumn('2008, Sales')
              ->addNumberColumn('2008, Expenses')
              ->addRow(['Q1/09', 1000,  400, 'Q1/08', 800, 300])
              ->addRow(['Q2/09', 1170,  460, 'Q2/08', 750, 400])
              ->addRow(['Q3/09',  660, 1120, 'Q3/08', 700, 540])
              ->addRow(['Q4/09', 1030,  540, 'Q4/08', 820, 620]);
    
        $lava->LineChart('Money', $table, [
          'width'=> 400,
          'height'=> 240,
          'legend'=>'right',
          'focusTarget'=> 'category'
        ]);
    
    Source code(tar.gz)
    Source code(zip)
  • 3.0.7(Mar 8, 2017)

  • 3.0.6(Jan 31, 2017)

  • 3.0.5(Jan 16, 2017)

  • 3.0.4(Apr 28, 2016)

  • 3.0.2(Mar 19, 2016)

    For existing users, the functionality of the customize method is now integrated into the constructor. No need for the extra method call.

    For new users, pass any option you want into the constructor. Use Google's doc pages for the full list of options they support.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.1(Feb 4, 2016)

  • 3.0.0(Jan 28, 2016)

    Major internal overhaul from version 2.5

    The notable additions are as follows:

    • Interactive Dashboards
    • Simplified syntax for chart creation and customization
    • Added Scatter and Table charts
    Source code(tar.gz)
    Source code(zip)
  • 2.5.10(Jan 22, 2016)

  • 3.0.0-beta2(Jan 7, 2016)

    With almost 350 commits and massive internal re-writes, this new version will provide a simpler syntax for creating charts and also bring a whole new feature, Dashboards!

    Source code(tar.gz)
    Source code(zip)
  • 2.5.9(Jan 7, 2016)

    Added customize() method to all charts to enable the use of config options that I may not have implemented yet, but are available to users from Google.

    For example, if you have a LineChart and want to use the chart explorer option, you can add this "unsupported" option with the customize() method.

    $lava->LineChart('MyChart')
         ->datatable($myData)
         ->customize([
             'explorer' => [
                 'actions' => [
                     'dragToPan',
                     'rightClickToReset'
                  ]
              ]
         ]);
    

    No more handcuffing (my accident, sorry!) and no more so-and-so is not a valid property for WhateverChart

    Source code(tar.gz)
    Source code(zip)
  • 2.5.7(Jul 7, 2015)

  • 2.5.6(Jun 29, 2015)

    Added some tweaks to the lava.loadData method and JavascriptFactory to use the saved formats and options, and only load new data via JSON.

    Source code(tar.gz)
    Source code(zip)
  • 2.5.5(Jun 10, 2015)

Owner
Kevin Hill
I love writing code, for work or for fun.
Kevin Hill
This package wraps up the standalone executable version of the Tailwind CSS framework for a Laravel application.

Tailwind CSS for Laravel Introduction This package wraps the standalone Tailwind CSS CLI tool. No Node.js required. Inspiration This package was inspi

Tony Messias 240 Nov 19, 2022
Register for multiple Livestorm sessions from an external form. Practical use of Livestorm API with PHP/Javascript.

Livestorm Multi Session Registration Register for multiple Livestorm sessions from an external form. Practical use of Livestorm API with PHP/Javascrip

Nathan CHEVALIER 0 Dec 24, 2021
A Laravel clone of the Javascript Flatpickr (Date picker) library

A Laravel clone of the Javascript Flatpickr (Date picker) library Using this package you can add a beautiful date or datetime picker into your project

Laratips 49 Dec 28, 2022
Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Jameson Lopp 28 Dec 19, 2022
Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C & C++

DocBlockr DocBlockr is a package for Sublime Text 2 & 3 which makes writing documentation a breeze. DocBlockr supports JavaScript (including ES6), PHP

Nick Fisher 3.1k Nov 25, 2022
Loja virtual fictícia para compra de produtos e estilização dos mesmos. Desenvolvido com as tecnologias: HTML, CSS, PHP, CODEIGNITER, JavaScript, Bootstrap e Mysql.

StampGeek Loja virtual fictícia para compra de produtos e estilização dos mesmos. Desenvolvido com as tecnologias: HTML, CSS, PHP, CODEIGNITER, JavaSc

Pablo Silva 1 Jan 13, 2022
PcTools is a proyect developed using {JavaScript,HTML5,CSS} for frontend and {PHP => Mysql} for backend.

PcTools-Proyect PcTools is a proyect developed using {JavaScript,HTML5,CSS} for frontend and {PHP => Mysql} for backend. Future Improvements # Replace

Ihab Fallahy 1 Feb 5, 2022
Video Chat application built using Metered Video SDK, with PHP Laravel Backend and JavaScript Front-End

Group Video Chat App with PHP Laravel and JavaScript Powered by Metered Video SDK Overview This application is a highly scalable group video calling a

null 2 Aug 18, 2022
Laravel routes from Javascript

Laravel Javascript Routes Why? I love the Laravel 4 routing system and I often use named routes like route('users.show', array('id' => 1)) to generate

Fede Isas 63 Oct 10, 2022
A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL

A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL Install To get started with SweetAle

Rashid Ali 939 Jan 8, 2023
Use ESM with importmap to manage modern JavaScript in Laravel without transpiling or bundling

Introduction Use ESM with importmap to manage modern JavaScript in Laravel without transpiling or bundling. Inspiration This package was inspired by t

Tony Messias 91 Dec 30, 2022
The Most Popular JavaScript Calendar as a Filament Widget 💛

The Most Popular JavaScript Calendar as a Filament Widget ?? Features Accepts all configurations from FullCalendar Event click and drop events Upcomin

Guilherme Saade 62 Dec 31, 2022
Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

Laravel Package for TMDB API Wrapper A Laravel package that provides easy access to the php-tmdb/api TMDB (The Movie Database) API wrapper. This packa

PHP - The Movie Database 151 Nov 1, 2022
BigBlueButton Server API Library for Laravel

BigBlueButton Server API Library for Laravel Package that provides easily communicate between BigBlueButton server and laravel framework Requirements

Jignesh 124 Jan 6, 2023
This is a courier api endpoints library for interacting such as e-courier, dhl, pathao etc

This is a courier api endpoints library for interacting such as e-courier, dhl, pathao etc Installation Step 1: composer require xenon/multicourier S

Ariful Islam 19 Sep 8, 2022
A Laravel Wrapper for the CoinDCX API. Now easily connect and consume the CoinDCX Public API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the CoinDCX API and allows you to easily communicate with it. Important Note This package is in early deve

Moinuddin S. Khaja 2 Feb 16, 2022
Lumen rest api demo with Dingo/Api, JWT, CORS, PHPUNIT

lumen-api-demo 这是一个比较完整用 lumen 5.7 写的的 REST API 例子。使用了 dingo/api ,jwt 实现登录,功能上很简单,登录,注册,发帖,评论,单元测试(正在补充)。 lumen5.x 请看对应的分支 有需要随时联系我 lumen/laravel/rest

Yu Li 859 Oct 25, 2022
The fastest way to make a powerful JSON:API compatible Rest API with Laravel.

The first fully customizable Laravel JSON:API builder. "CRUD" and protect your resources with 0 (zero) extra line of code. Installation You can instal

BinarCode 288 Aug 8, 2022
Public API for the project coding.events. Made in PHP 8.0 with Lumen 8, PHP-FPM, NGINX and MySQL 8.

coding.events API Uma API feita apenas para passar o tempo, montando uma API para o site <coding.events>. Sinta-se livre para usar esse código como es

Kaique Garcia 3 Oct 9, 2022