datalogix/laravel-charts 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

datalogix/laravel-charts

最新稳定版本:v0.1.2

Composer 安装命令:

composer require datalogix/laravel-charts

包简介

Laravel charts is a package to simplify the use of charts.

README 文档

README

Latest Stable Version Total Downloads tests StyleCI codecov License

Laravel charts is a package to simplify the use of charts.

Features

  • Autoregister your charts
  • Customize routing, middleware and prefix to your charts
  • Command to create a new chart php artisan make:chart ChartName

Installation

You can install the package via composer:

composer require datalogix/laravel-charts

The package will automatically register itself.

Configuration

The defaults are set in config/charts.php. Copy this file to your own config directory to modify the values. You can publish the config using this command:

php artisan vendor:publish --provider="Datalogix\Charts\ChartsServiceProvider" --tag="config"

Commands

You can start creating charts with the typical make command by laravel artisan.

php artisan make:chart SampleChart

This will create a SampleChart class under App\Charts namespace.

Render Charts

Laravel charts can be used without any rendering on the PHP side. Meaning it can be used and server as an API endpoint. There's no need to modify the configuration files or the chart to do such.

However, if you do not plan to develop the front-end as a SPA or in a different application and can use the laravel Blade syntax, you can then use the @chart helper to create charts.

The @chart blade helper does accept a string containing the chart name to get the URL of. The following example can be used as a guide:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Charts example</title>
  </head>
  <body>
    <!-- Chart container -->
    <div id="chart" style="height: 300px;"></div>
    <!-- Chart library -->
    <script src="https://unpkg.com/echarts/dist/echarts.min.js"></script>
    <!-- Chartisan -->
    <script src="https://unpkg.com/@chartisan/echarts/dist/chartisan_echarts.js"></script>
    <!-- Your application script -->
    <script>
      const chart = new Chartisan({
        el: '#chart',
        url: "@chart('sample_chart')",
      });
    </script>
  </body>
</html>

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固