定制 jxlwqq/echarts 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jxlwqq/echarts

最新稳定版本:v1.0.2

Composer 安装命令:

composer require jxlwqq/echarts

包简介

echarts for laravel-admin

README 文档

README

Installation

composer require jxlwqq/echarts

php artisan vendor:publish --tag=laravel-admin-echarts

Configuration

Open config/admin.php, add configurations that belong to this extension at extensions section.

    'extensions' => [
        'echarts' => [
            // Set to `false` if you want to disable this extension
            'enable' => true,
        ]
    ]

Usage

Create a view in views directory like resources/views/admin/echarts.blade.php, and add following codes:

<!-- prepare a DOM container with width and height -->
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
    $(function () {
        // based on prepared DOM, initialize echarts instance
        var myChart = echarts.init(document.getElementById('main'));

        // specify chart configuration item and data
        var option = {
            title: {
                text: 'ECharts entry example'
            },
            tooltip: {},
            legend: {
                data: ['Sales']
            },
            xAxis: {
                data: ["shirt", "cardign", "chiffon shirt", "pants", "heels", "socks"]
            },
            yAxis: {},
            series: [{
                name: 'Sales',
                type: 'bar',
                data: [5, 20, 36, 10, 10, 20]
            }]
        };

        // use configuration item and data specified to show chart
        myChart.setOption(option);
    });
</script>

Then show it on the page

class EchartsController extends Controller
{
    public function index(Content $content)
    {
        return $content
            ->header('Echarts')
            ->body(new Box('echarts demo', view('admin.echarts')));
    }
}

For more usage, please refer to the official website of echarts.

License

Licensed under The MIT License (MIT).

统计信息

  • 总下载量: 16.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-27