https://github.com/liudding/laravel-echarts
Build ECharts with laravel
https://github.com/liudding/laravel-echarts
Last synced: about 1 month ago
JSON representation
Build ECharts with laravel
- Host: GitHub
- URL: https://github.com/liudding/laravel-echarts
- Owner: liudding
- Created: 2021-01-06T10:09:06.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-25T02:26:26.000Z (over 5 years ago)
- Last Synced: 2025-01-22T08:15:38.954Z (over 1 year ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# laravel echarts
Build ECharts using laravel
## Install
```
composer require ding/laravel-echarts
```
## Usage
In your php file or block:
```php
$chart = app('chart')->locale('ZH')
->addSeries([
'name' => 'Series #1',
'type' => 'line',
'data' => [1, 3, 2, 2, 4, 12, 5]
])
->addSeries([
'name' => 'Series #2',
'type' => 'line',
'data' => [3, 1, 3, 4, 2, 11, 3]
])
->xAxis(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'])
->yAxis()
->legend() // 自动根据 series names 设置 legend
->lazy(); // 懒加载
```
In your `blade` file
```php
{!! $chart->render() !!}
```