All Projects → kevinkhill → Lavacharts

kevinkhill / Lavacharts

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

Projects that are alternatives of or similar to Lavacharts

ipychart
The power of Chart.js with Python
Stars: ✭ 48 (-91.82%)
Mutual labels:  charts, charting-library
ux-charts
Simple, responsive, modern Charts with zero dependencies
Stars: ✭ 22 (-96.25%)
Mutual labels:  charts, charting-library
HCLineChartView
HCLineChartView is a beautiful iOS library for drawing line charts. It is highly customizable and easy to use.
Stars: ✭ 22 (-96.25%)
Mutual labels:  charts, charting-library
Angular Chartist.js
Angular directive for Chartist.js
Stars: ✭ 206 (-64.91%)
Mutual labels:  charts, charting-library
React Jsx Highcharts
Highcharts built with proper React components
Stars: ✭ 336 (-42.76%)
Mutual labels:  charts, charting-library
Keen Dataviz.js
Data Visualization Charting Library
Stars: ✭ 215 (-63.37%)
Mutual labels:  charts, charting-library
Plotly.swift
Interactive data visualization library for Swift
Stars: ✭ 70 (-88.07%)
Mutual labels:  charts, charting-library
React D3 Components
D3 Components for React
Stars: ✭ 1,599 (+172.4%)
Mutual labels:  charts, charting-library
Fcharts
📊 [wip] Create beautiful, responsive, animated charts using a simple and intuitive API.
Stars: ✭ 318 (-45.83%)
Mutual labels:  charts, charting-library
Lightweight Charts
Financial lightweight charts built with HTML5 canvas
Stars: ✭ 4,390 (+647.87%)
Mutual labels:  charts, charting-library
Plotly.js
Open-source JavaScript charting library behind Plotly and Dash
Stars: ✭ 14,268 (+2330.66%)
Mutual labels:  charts, charting-library
Flutter echarts
A Flutter widget to use Apache ECharts (incubating) in a reactive way.
Stars: ✭ 420 (-28.45%)
Mutual labels:  charts, charting-library
Graphic
A Flutter data visualization library based on Grammar of Graphics.
Stars: ✭ 173 (-70.53%)
Mutual labels:  charts, charting-library
gauge-chart
Gauge Chart Library
Stars: ✭ 45 (-92.33%)
Mutual labels:  charts, charting-library
Matplotplusplus
Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
Stars: ✭ 2,433 (+314.48%)
Mutual labels:  charts, charting-library
svg-time-series
SVG time-series charting library
Stars: ✭ 18 (-96.93%)
Mutual labels:  charts, charting-library
Svelte Frappe Charts
📈 Svelte bindings for frappe-charts.
Stars: ✭ 111 (-81.09%)
Mutual labels:  charts, charting-library
Anychart Android
AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
Stars: ✭ 1,762 (+200.17%)
Mutual labels:  charts, charting-library
Anychart
AnyChart is a lightweight and robust JavaScript charting solution with great API and documentation. The chart types and unique features are numerous, the library works easily with any development stack.
Stars: ✭ 288 (-50.94%)
Mutual labels:  charts, charting-library
React Chartjs 2
React components for Chart.js, the most popular charting library
Stars: ✭ 4,667 (+695.06%)
Mutual labels:  charts, charting-library

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].