conquer / flot
Yii2 flot 小部件
dev-master / 1.0.2.x-dev
2015-12-09 07:17 UTC
Requires
- php: >=5.4.0
- bower-asset/flot: ~0.8.3
- conquer/excanvas: *
- conquer/helpers: *
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-09-24 03:59:37 UTC
README
描述
Flot 是一个专注于简单使用、美观和交互功能的 jQuery 纯 JavaScript 绘图库。它支持 Internet Explorer 6+、Chrome、Firefox 2+、Safari 3+ 和 Opera 9.5+。更多详情请访问 Flot
安装
建议通过 composer 来安装此扩展。
安装方法如下:
$ php composer.phar require conquer/flot "*"
或者添加以下内容到您的 composer.json
文件的 require
部分:
"conquer/flot": "*"
使用方法
use conquer\flot\FlotWidget; <= FlotWidget::widget([ 'htmlOptions'=>['class'=>'chart'], 'data'=>[ ['labels'=>'Unique Visits', 'data'=>array_map(function($v){return [$v, rand(10,50)];}, range(1, 30))], ['labels'=>'Page Views', 'data'=>array_map(function($v){return [$v, rand(10,50)];}, range(1, 30))], ], 'options'=>[ 'series'=>[ 'lines'=> [ 'show'=> true, 'lineWidth'=> 2, 'fill'=> true, 'fillColor'=> ['colors'=> [ ['opacity'=>0.05], ['opacity'=>0.01], ]], ], 'points'=>['show'=>true], 'shadowSize'=> 2, ], 'grid'=> [ 'hoverable'=> true, 'clickable'=> true, 'tickColor'=> "#eee", 'borderWidth'=> 0, ], 'colors'=> ["#d12610", "#37b7f3", "#52e136"], 'xaxis' => [ 'ticks'=> 11, 'tickDecimals'=> 0, ], 'yaxis'=> [ 'ticks'=> 11, 'tickDecimals'=> 0, ] ], ]); =>
许可证
conquer/flot 采用 MIT 许可证发布。有关详细信息,请参阅附带的 LICENSE.md
文件。