simialbi/yii2-widget-chart

为yii2框架实现的amcharts图表

安装次数: 2,873

依赖者: 5

建议者: 0

安全性: 0

星标: 1

关注者: 2

分支: 4

开放问题: 0

类型:yii2-extension

0.8.1 2022-08-12 09:04 UTC

README

amcharts4库的包装器。

Latest Stable Version Total Downloads Build Status License

资源

安装

安装此扩展的首选方式是通过composer

运行以下命令之一:

$ php composer.phar require --prefer-dist "simialbi/yii2-widget-chart"

或者将以下内容添加到composer.jsonrequire部分:

{
	"require": {
  		"simialbi/yii2-widget-chart": "^0.5"
	}
}

require

示例用法

<?php
/* @var $this yii\web\View */
/* @var $image stdClass */

use simialbi\yii2\chart\widgets\LineChart;

$this->title = 'my example';
$this->params['breadcrumbs'][] = $this->title;

?>
<div class="my-example">
<?php
echo  LineChart::widget([
  'data' => [
      [
          'country' => 'Lithuania',
          'litres' => 501.9
      ],
      [
          'country' => 'Czech Republic',
          'litres' => 301.9
      ],
      [
          'country' => 'Ireland',
          'litres' => 201.1
      ],
      [
          'country' => 'Germany',
          'litres' => 165.8
      ],
      [
          'country' => 'Australia',
          'litres' => 139.9
      ],
      [
          'country' => 'Austria',
          'litres' => 128.3
      ],
      [
          'country' => 'UK',
          'litres' => 99
      ],
      [
          'country' => 'Belgium',
          'litres' => 60
      ],
      [
          'country' => 'The Netherlands',
          'litres' => 50
      ]
  ]
]);
?>
</div>

许可证

yii2-widget-chart采用MIT许可证发布。有关详细信息,请参阅打包的LICENSE