antoineaugusti/easyphpcharts
Composer 安装命令:
composer require antoineaugusti/easyphpcharts
包简介
A PHP class for chartjs.org charts.
README 文档
README
A simple PHP class for http://www.chartjs.org charts. Draw a beautiful chart with 5 lines of PHP!
Documentation
You can find documentation at antoineaugusti.github.io/EasyPHPCharts. Take also a look at the file examples/examples.php.
Examples
/* // A basic example of a pie chart */ $pieChart = new Chart('pie', 'examplePie'); $pieChart->set('data', array(2, 10, 16, 30, 42)); $pieChart->set('legend', array('Work', 'Eat', 'Sleep', 'Listen to music', 'Code')); $pieChart->set('displayLegend', true); echo $pieChart->returnFullHTML(); /* // An example of a doughnut chart with legend in percentages */ $doughnutChart = new Chart('doughnut', 'exampleDoughnut'); $doughnutChart->set('data', array(2, 10, 16, 30, 42)); $doughnutChart->set('legend', array('Work', 'Eat', 'Sleep', 'Listen to music', 'Code')); $doughnutChart->set('displayLegend', true); $doughnutChart->set('legendIsPercentage', true); echo $doughnutChart->returnFullHTML(); /* // An example of a bar chart with multiple datasets */ $barChart = new Chart('bar', 'examplebar'); $barChart->set('data', array(array(2, 10, 16, 30, 42), array(42, 30, 16, 10, 2))); $barChart->set('legend', array('01/01', '01/02', '01/03', '01/04', '01/05')); // We don't to use the x-axis for the legend so we specify the name of each dataset $barChart->set('legendData', array('Annie', 'Marc')); $barChart->set('displayLegend', true); echo $barChart->returnFullHTML(); /* // An example of a radar chart */ $radarChart = new Chart('radar', 'exampleradar'); $radarChart->set('data', array(20, 55, 16, 30, 42)); $radarChart->set('legend', array('A', 'B', 'C', 'D', 'E')); echo $radarChart->returnFullHTML(); /* // An example of a polar chart */ $polarChart = new Chart('polar', 'examplepolar'); $polarChart->set('data', array(20, 55, 16, 30, 42)); $polarChart->set('legend', array('A', 'B', 'C', 'D', 'E')); echo $polarChart->returnFullHTML();
CSS
Some CSS classes will be added to the HTML produced. An example CSS file:
.chartContainer { float: left; width: 500px; } .containerChartLegend { float: right; width: 500px; } canvas.chart { margin: 20px auto; display: block; } canvas.chart:after { clear: both; } .colorBlock { display: inline-block; width: 45px; height: 15px; vertical-align: middle; margin-right: 15px; } ul.chartLegend { list-style: none; margin-bottom: 30px; } ul.chartLegend li { margin-bottom: 5px; } .floatRight { float: right; } .clearBoth { clear: both; }
antoineaugusti/easyphpcharts 适用场景与选型建议
antoineaugusti/easyphpcharts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.07k 次下载、GitHub Stars 达 25, 最近一次更新时间为 2014 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「chart」 「charts」 「visualization」 「chartjs」 「php charts」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 antoineaugusti/easyphpcharts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 antoineaugusti/easyphpcharts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 antoineaugusti/easyphpcharts 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple PHP chart drawing library
Google Charts the Yii 2.0 way
The "View Counter" bundle
Yii2 chartjs
A Versatile and Expandable jQuery Plotting Plugin
PHP library for c3js
统计信息
- 总下载量: 3.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-08-02