定制 onixsib/yii2-chartjs-widget 二次开发

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

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

onixsib/yii2-chartjs-widget

最新稳定版本:2.0.4

Composer 安装命令:

composer require onixsib/yii2-chartjs-widget

包简介

ChartJs widget for Yii2.

README 文档

README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

Renders a ChartJs plugin widget

Installation

The preferred way to install this extension is through composer. This requires the composer-asset-plugin, which is also a dependency for yii2 – so if you have yii2 installed, you are most likely already set.

Either run

composer require 2amigos/yii2-chartjs-widget:~2.0

or add

"2amigos/yii2-chartjs-widget" : "~2.0"

to the require section of your application's composer.json file.

Usage

The following types are supported:

  • Line
  • Bar
  • Radar
  • Polar
  • Pie
  • Doughnut

The following example is using the Line type of chart. Please, check ChartJs plugin documentation for the different types supported by the plugin.

use dosamigos\chartjs\ChartJs;

<?= ChartJs::widget([
    'type' => 'line',
    'options' => [
        'height' => 400,
        'width' => 400
    ],
    datasets =>
    [
        [
            'label' => "My First dataset",
            'backgroundColor' => "rgba(179,181,198,0.2)",
            'borderColor' => "rgba(179,181,198,1)",
            'pointBackgroundColor' => "rgba(179,181,198,1)",
            'pointBorderColor' => "#fff",
            'pointHoverBackgroundColor' => "#fff",
            'pointHoverBorderColor' => "rgba(179,181,198,1)",
            'data' => [65, 59, 90, 81, 56, 55, 40]
        ],
        [
            'label' => "My Second dataset",
            'backgroundColor' => "rgba(255,99,132,0.2)",
            'borderColor' => "rgba(255,99,132,1)",
            'pointBackgroundColor' => "rgba(255,99,132,1)",
            'pointBorderColor' => "#fff",
            'pointHoverBackgroundColor' => "#fff",
            'pointHoverBorderColor' => "rgba(255,99,132,1)",
            'data' => [28, 48, 40, 19, 96, 27, 100]
        ]
    ]
]);
?>

Further Information

ChartJs has lots of configuration options. For further information, please check the ChartJs plugin website.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The BSD License (BSD). Please see License File for more information.

2amigOS!
Web development has never been so fun!
www.2amigos.us

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固