{"id":13452893,"url":"https://github.com/kevinkhill/lavacharts","last_synced_at":"2025-05-14T23:06:04.555Z","repository":{"id":10335380,"uuid":"12467877","full_name":"kevinkhill/lavacharts","owner":"kevinkhill","description":"Lavacharts is a graphing / charting library for PHP 5.4+ that wraps Google's Javascript Chart API.","archived":false,"fork":false,"pushed_at":"2024-04-26T19:57:44.000Z","size":11443,"stargazers_count":621,"open_issues_count":23,"forks_count":142,"subscribers_count":22,"default_branch":"3.1","last_synced_at":"2025-04-13T19:50:00.136Z","etag":null,"topics":["charting-library","charts","composer","google-charts","graphing","php"],"latest_commit_sha":null,"homepage":"http://lavacharts.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevinkhill.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-29T18:27:11.000Z","updated_at":"2025-03-26T15:02:44.000Z","dependencies_parsed_at":"2024-06-18T11:26:21.871Z","dependency_job_id":null,"html_url":"https://github.com/kevinkhill/lavacharts","commit_stats":{"total_commits":1205,"total_committers":24,"mean_commits":"50.208333333333336","dds":0.02655601659751039,"last_synced_commit":"22f61ac600fac77f737c6c08c6462f04a900ce89"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinkhill%2Flavacharts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinkhill%2Flavacharts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinkhill%2Flavacharts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinkhill%2Flavacharts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinkhill","download_url":"https://codeload.github.com/kevinkhill/lavacharts/tar.gz/refs/heads/3.1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243358,"owners_count":22038046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["charting-library","charts","composer","google-charts","graphing","php"],"created_at":"2024-07-31T08:00:26.430Z","updated_at":"2025-05-14T23:05:59.540Z","avatar_url":"https://github.com/kevinkhill.png","language":"PHP","funding_links":["https://www.paypal.me/kevinkhill/"],"categories":["Popular Packages","PHP"],"sub_categories":[],"readme":"# Lavacharts 3.1.12\n\n[![Total Downloads](https://img.shields.io/packagist/dt/khill/lavacharts.svg?style=plastic)](https://packagist.org/packages/khill/lavacharts)\n[![License](https://img.shields.io/packagist/l/khill/lavacharts.svg?style=plastic)](http://opensource.org/licenses/MIT)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.4-8892BF.svg?style=plastic)](https://php.net/)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kevinkhill/lavacharts?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![PayPal](https://img.shields.io/badge/paypal-donate-yellow.svg?style=plastic)](https://www.paypal.me/kevinkhill/)\n\nLavacharts is a graphing / chart library for PHP5.4+ that wraps the Google Chart API.\n\nStable:\n[![Current Release](https://img.shields.io/github/release/kevinkhill/lavacharts.svg?style=plastic)](https://github.com/kevinkhill/lavacharts/releases)\n[![Build Status](https://img.shields.io/travis/kevinkhill/lavacharts/3.1.svg?style=plastic)](https://travis-ci.org/kevinkhill/lavacharts)\n[![Coverage Status](https://img.shields.io/coveralls/kevinkhill/lavacharts/3.1.svg?style=plastic)](https://coveralls.io/r/kevinkhill/lavacharts?branch=3.1)\n\nDev:\n[![Development Release](https://img.shields.io/badge/release-dev--master-brightgreen.svg?style=plastic)](https://github.com/kevinkhill/lavacharts/tree/master)\n[![Build Status](https://img.shields.io/travis/kevinkhill/lavacharts/master.svg?style=plastic)](https://travis-ci.org/kevinkhill/lavacharts)\n[![Coverage Status](https://img.shields.io/coveralls/kevinkhill/lavacharts/master.svg?style=plastic)](https://coveralls.io/r/kevinkhill/lavacharts?branch=master)\n\n## Developer Note\nPlease 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:\n\n## Package Features\n- **Updated!** Laravel 5.5+ auto-discovery\n- Any option for customizing charts that Google supports, Lavacharts should as well. Just use the chart constructor to assign any customization options you wish!\n - Visit [Google's Chart Gallery](https://developers.google.com/chart/interactive/docs/gallery) for details on available options\n- Custom JavaScript module for interacting with charts client-side\n  - AJAX data reloading\n  - Fetching charts\n  - Events integration\n- Column Formatters \u0026 Roles\n- Blade template extensions for Laravel\n- Twig template extensions for Symfony\n- [Carbon](https://github.com/briannesbitt/Carbon) support for date/datetime/timeofday columns\n- Now supporting **22** Charts!\n  - Annotation, Area, Bar, Bubble, Calendar, Candlestick, Column, Combo, Gantt, Gauge, Geo, Histogram, Line, Org, Pie, Sankey, Scatter, SteppedArea, Table, Timeline, TreeMap, and WordTree!\n\n\n### For complete documentation, please visit [lavacharts.com](http://lavacharts.com/)\n\n#### Upgrade guide: [Migrating from 2.5.x to 3.0.x](https://github.com/kevinkhill/lavacharts/wiki/Upgrading-from-2.5-to-3.0)\n#### For contributing, a handy guide [can be found here](https://github.com/kevinkhill/lavacharts/blob/master/.github/CONTRIBUTING.md)\n\n---\n\n## Installing\nIn your project's main `composer.json` file, add this line to the requirements:\n```json\n\"khill/lavacharts\": \"^3.1\"\n```\n\nRun Composer to install Lavacharts:\n```bash\n$ composer update\n```\n\n## Framework Agnostic\nIf you are using Lavacharts with Silex, Lumen or your own Composer project, that's no problem! Just make sure to:\n`require 'vendor/autoload.php';` within you project and create an instance of Lavacharts: `$lava = new Khill\\Lavacharts\\Lavacharts;`\n\n\n## Laravel\nTo integrate Lavacharts into Laravel, a ServiceProvider has been included.\n\n\n### Laravel ~5.5\nThanks to the fantastic new [Package Auto-Discovery](https://laravel-news.com/package-auto-discovery) feature added in 5.5, you're ready to go, no registration required :+1:\n\n#### Configuration\nTo modify the default configuration of Lavacharts, datetime formats for datatables or adding your maps api key...\nPublish the configuration with `php artisan vendor:publish --tag=lavacharts`\n\n### Laravel ~5.4\nRegister Lavacharts in your app by adding these lines to the respective arrays found in `config/app.php`:\n```php\n\u003c?php\n// config/app.php\n\n// ...\n'providers' =\u003e [\n    // ...\n\n    Khill\\Lavacharts\\Laravel\\LavachartsServiceProvider::class,\n],\n\n// ...\n'aliases' =\u003e [\n    // ...\n\n    'Lava' =\u003e Khill\\Lavacharts\\Laravel\\LavachartsFacade::class,\n]\n```\n#### Configuration\nTo modify the default configuration of Lavacharts, datetime formats for datatables or adding your maps api key...\nPublish the configuration with `php artisan vendor:publish --tag=lavacharts`\n\n\n### Laravel ~4\nRegister Lavacharts in your app by adding these lines to the respective arrays found in `app/config/app.php`:\n\n```php\n\u003c?php\n// app/config/app.php\n\n// ...\n'providers' =\u003e array(\n    // ...\n\n    \"Khill\\Lavacharts\\Laravel\\LavachartsServiceProvider\",\n),\n\n// ...\n'aliases' =\u003e array(\n    // ...\n\n    'Lava' =\u003e \"Khill\\Lavacharts\\Laravel\\LavachartsFacade\",\n)\n```\n#### Configuration\nTo modify the default configuration of Lavacharts, datetime formats for datatables or adding your maps api key...\nPublish the configuration with `php artisan config:publish khill/lavacharts`\n\n\n## Symfony\nThe package also includes a Bundle for Symfony to enable Lavacharts as a service that can be pulled from the Container.\n\n### Add Bundle\nAdd the bundle to the registerBundles method in the AppKernel, found at `app/AppKernel.php`:\n```php\n\u003c?php\n// app/AppKernel.php\n\nclass AppKernel extends Kernel\n{\n    // ..\n\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n\n            new Khill\\Lavacharts\\Symfony\\Bundle\\LavachartsBundle(),\n        );\n    }\n}\n```\n### Import Config\nAdd the service definition to the `app/config/config.yml` file\n```yaml\nimports:\n  # ...\n  - { resource: \"@LavachartsBundle/Resources/config/services.yml\"\n```\n\n\n# Usage\nThe creation of charts is separated into two parts:\nFirst, within a route or controller, you define the chart, the data table, and the customization of the output.\n\nSecond, within a view, you use one line and the library will output all the necessary JavaScript code for you.\n\n## Basic Example\nHere is an example of the simplest chart you can create: A line chart with one dataset and a title, no configuration.\n\n### Controller\nSetting up your first chart.\n\n#### Data\n```php\n$data = $lava-\u003eDataTable();\n\n$data-\u003eaddDateColumn('Day of Month')\n     -\u003eaddNumberColumn('Projected')\n     -\u003eaddNumberColumn('Official');\n\n// Random Data For Example\nfor ($a = 1; $a \u003c 30; $a++) {\n    $rowData = [\n      \"2017-4-$a\", rand(800,1000), rand(800,1000)\n    ];\n\n    $data-\u003eaddRow($rowData);\n}\n```\n\nArrays work for datatables as well...\n```php\n$data-\u003eaddColumns([\n    ['date', 'Day of Month'],\n    ['number', 'Projected'],\n    ['number', 'Official']\n]);\n```\n\nOr you can `use \\Khill\\Lavacharts\\DataTables\\DataFactory` [to create DataTables in another way](https://gist.github.com/kevinkhill/0c7c5f6211c7fd8f9658)\n\n#### Chart Options\nCustomize your chart, with any options found in Google's documentation. Break objects down into arrays and pass to the chart.\n```php\n$lava-\u003eLineChart('Stocks', $data, [\n    'title' =\u003e 'Stock Market Trends',\n    'animation' =\u003e [\n        'startup' =\u003e true,\n        'easing' =\u003e 'inAndOut'\n    ],\n    'colors' =\u003e ['blue', '#F4C1D8']\n]);\n```\n\n#### Output ID\nThe chart will needs to be output into a div on the page, so an html ID for a div is needed.\nHere is where you want your chart `\u003cdiv id=\"stocks-div\"\u003e\u003c/div\u003e`\n - If no options for the chart are set, then the third parameter is the id of the output:\n```php\n$lava-\u003eLineChart('Stocks', $data, 'stocks-div');\n```\n - If there are options set for the chart, then the id may be included in the options:\n```php\n$lava-\u003eLineChart('Stocks', $data, [\n    'elementId' =\u003e 'stocks-div'\n    'title' =\u003e 'Stock Market Trends'\n]);\n```\n - The 4th parameter will also work:\n```php\n$lava-\u003eLineChart('Stocks', $data, [\n    'title' =\u003e 'Stock Market Trends'\n], 'stocks-div');\n```\n\n\n## View\nPass the main Lavacharts instance to the view, because all of the defined charts are stored within, and render!\n```php\n\u003c?= $lava-\u003erender('LineChart', 'Stocks', 'stocks-div'); ?\u003e\n```\n\nOr if you have multiple charts, you can condense theh view code withL\n```php\n\u003c?= $lava-\u003erenderAll(); ?\u003e\n```\n\n\n# Changelog\nThe complete changelog can be found [here](https://github.com/kevinkhill/lavacharts/wiki/Changelog)\n\n## Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/kevinkhill/lavacharts.svg)](https://starchart.cc/kevinkhill/lavacharts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinkhill%2Flavacharts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinkhill%2Flavacharts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinkhill%2Flavacharts/lists"}