https://github.com/julles/laravel-highcharts
Laravel 5 Highcharts Package
https://github.com/julles/laravel-highcharts
highcharts laravel laravel5 laravel5-package
Last synced: 3 months ago
JSON representation
Laravel 5 Highcharts Package
- Host: GitHub
- URL: https://github.com/julles/laravel-highcharts
- Owner: julles
- Created: 2016-01-17T09:20:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-23T06:16:52.000Z (about 2 years ago)
- Last Synced: 2025-02-01T04:31:40.275Z (3 months ago)
- Topics: highcharts, laravel, laravel5, laravel5-package
- Language: PHP
- Size: 24.4 KB
- Stars: 31
- Watchers: 8
- Forks: 15
- Open Issues: 11
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Laravel 5 Highcharts Packages
[](https://packagist.org/packages/muhamadrezaar/highcharts)
[](https://packagist.org/packages/muhamadrezaar/highcharts)
[](https://github.com/julles/laravel-highcharts/releases)
[](https://github.styleci.io/repos/49810531/shield)Package Highcharts for Laravel 5
### Installations
Add Package to composer.json
```sh
composer require muhamadrezaar/highcharts:dev-master
```
In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider and facade in config/app.php file:Provider :
```sh
RezaAr\Highcharts\Provider::class,
```
Facade :
```sh
'Chart' => RezaAr\Highcharts\Facade::class,
```then publish the config
``` sh
php artisan vendor:publish
```### Basic Usage
In Controller or Other Class
```sh
'Voting ballon d`or 2018',
])
->chart([
'type' => 'line', // pie , columnt ect
'renderTo' => 'chart1', // render the chart into your div with id
])
->subtitle([
'text' => 'This Subtitle',
])
->colors([
'#0c2959'
])
->xaxis([
'categories' => [
'Alex Turner',
'Julian Casablancas',
'Bambang Pamungkas',
'Mbah Surip',
],
'labels' => [
'rotation' => 15,
'align' => 'top',
'formatter' => 'startJs:function(){return this.value + " (Footbal Player)"}:endJs',
// use 'startJs:yourjavasscripthere:endJs'
],
])
->yaxis([
'text' => 'This Y Axis',
])
->legend([
'layout' => 'vertikal',
'align' => 'right',
'verticalAlign' => 'middle',
])
->series(
[
[
'name' => 'Voting',
'data' => [43934, 52503, 57177, 69658],
// 'color' => '#0c2959',
],
]
)
->display();return view('welcome', [
'chart1' => $chart1,
]);?>
```
In Blade```sh
{!! $chart1 !!}
```
Output :
the package will generate this code in yout view :
``` sh
Highcharts.chart( {
title: {
"text": "Voting ballon d`or 2018"
}
, subtitle: {
"text": "This Subtitle"
}
, yAxis: {
"text": "This Y Axis"
}
, xAxis: {
"categories":["Messi", "CR7", "Bambang Pamungkas", "Del Piero"], "labels": {
"rotation":15, "align":"top", "formatter":function() {
return this.value + " (Footbal Player)"
}
}
}
, legend: {
"layout": "vertikal", "align": "right", "verticalAlign": "middle"
}
, series: [ {
"name": "Voting", "data": [43934, 52503, 57177, 69658]
}
], chart: {
"type": "line", "renderTo": "chart1"
}
, colors: ["#0c2959"], credits:false
});
```
cdn highcharts.js and others js only generated one time
## License
https://reza.mit-license.org/
Buy me a cup of coffee
https://trakteer.id/mreza.id