bburim/flot
Composer 安装命令:
composer require bburim/flot
包简介
jQuery Flot Charts extension for the Yii 2 framework
README 文档
README
This is extension for Yii 2.
It is actually a wrapper for jQuery Flot Charts library.
If you want to learn more about Flot options and documentation, please visit http://www.flotcharts.org/
Installation
As all Yii 2 Extensions, this one should be installed through Composer too.
Composer can be downloaded here: https://getcomposer.org/
Extension in the list of Composer packages: https://packagist.org/packages/bburim/flot
Installation command:
php composer.phar require "bburim/flot"
Basic Usage
<?php
use bburim\flot\Chart as Chart;
echo Chart::widget([
'data' => [
[
'label' => 'line',
'data' => [
[1, 1],
[2,7],
[3,12],
[4,32],
[5,62],
[6,89],
],
'lines' => ['show' => true],
'points' => ['show' => true],
],
[
'label' => 'bars',
'data' => [
[1,12],
[2,16],
[3,89],
[4,44],
[5,38],
],
'bars' => ['show' => true],
],
],
'options' => [
'legend' => [
'position' => 'nw',
'show' => true,
'margin' => 10,
'backgroundOpacity' => 0.5
],
],
'htmlOptions' => [
'style' => 'width:400px;height:400px;'
]
]);
?>
Options and parameters
This extension allows you to provide some parameters to configure how your chart will be rendered.
tagName - DOM element tag name. Default value is 'div';
htmlOptions - HTML options for DOM container.
options - options array, which will be converted to JSON and transfered to jQuery as third parameter when calling function to create chart.
data - data array, which will be converted to JSON and transfered to jQuery as second parameter when calling function to create chart.
excanvas - true/false. Whether to include excanvas.js or not.
Using plugins
Sometimes you need to include some Flot plugin to make your Chart more interactive.
The following example shows what needs to be added to include, for example, jquery.flot.canvas.js extension:
<?php
use bburim\flot\Chart as Chart;
use bburim\flot\Plugin as Plugin;
echo Chart::widget([
'data' => [
// As before
],
'options' => [
// As before
],
'htmlOptions' => [
// As before
],
// Use `plugins` attribute to load required plugins
'plugins' => [
// Use helper class with constants to specify plugin type
Plugin::CANVAS
]
]);
?>
The following plugins are currently available as constants:
jquery.flot.canvas.js as Plugin::CANVAS
jquery.flot.categories.js as Plugin::CATEGORIES
jquery.flot.crosshair.js as Plugin::CROSSHAIR
jquery.flot.errorbars.js as Plugin::ERRORBARS
jquery.flot.fillbetween.js as Plugin::FILLBETWEEN
jquery.flot.image.js as Plugin::IMAGE
jquery.flot.navigate.js as Plugin::NAVIGATE
jquery.flot.pie.js as Plugin::PIE
jquery.flot.resize.js as Plugin::RESIZE
jquery.flot.selection.js as Plugin::SELECTION
jquery.flot.stack.js as Plugin::STACK
jquery.flot.symbol.js as Plugin::SYMBOL
jquery.flot.threshold.js as Plugin::THRESHOLD
jquery.flot.time.js as Plugin::TIME
bburim/flot 适用场景与选型建议
bburim/flot 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 8.59k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2014 年 02 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「jquery」 「chart」 「yii」 「flot」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bburim/flot 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bburim/flot 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bburim/flot 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple PHP chart drawing library
Yii2 chartjs
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Priveate for SkeekS CMS
This is a laravel 4 package for the server and client side of datatables at http://datatables.net/
Composer Friendly, full refactor of JpGraph, library to make graphs and charts
统计信息
- 总下载量: 8.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GNU
- 更新时间: 2014-02-14