mauro-moreno / laravel-highcharts by mauro-moreno

This is a package for generating a Highchart JSON config.
3,804
16
5
Package Data
Maintainer Username: mauro-moreno
Maintainer Contact: mmoreno@aivo.co (Mauro Moreno)
Package Create Date: 2015-01-23
Package Last Update: 2016-02-05
Language: PHP
License: MIT
Last Refreshed: 2024-03-27 03:01:41
Package Statistics
Total Downloads: 3,804
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 16
Total Watchers: 5
Total Forks: 10
Total Open Issues: 0

laravel-highcharts

This is a package for generating a Highchart JSON config.

Based in PHP Highcharts.

Installation

Run the following command and provide the latest stable version (e.g v2.4.15) :

composer require mauro-moreno/laravel-highcharts

or add the following to your composer.json file :

"mauro-moreno/laravel-highcharts": "^1.0.0"

Then register this service provider with Laravel :

'providers' => [
    ...
    Aivo\Highchart\HighchartServiceProvider::class,
    ...
]

Usage

Create a chart:

$chart = App::make('highchart')
    ->setTitle('Scatter plot with regression line')
    ->addSeries(
        array(
            ScatterSeries::factory()
                ->setName('Observations')
                ->addData(array(1, 1.5, 2.8, 3.5, 3.9, 4.2)),
            LineSeries::factory()
                ->setName('Regression line')
                ->addDataPoint(DataPoint::factory(0, 1.11))
                ->addDataPoint(DataPoint::factory(5, 4.51))
                ->getMarker()->setEnabled(false)->getSeries()
                ->setEnableMouseTracking(false),
        )
    )
;
$chart->render();