kalamurda/amcharts-bundle
最新稳定版本:3.0.2
Composer 安装命令:
composer require kalamurda/amcharts-bundle
包简介
Symfony-bundle for building amcharts with php code
README 文档
README
symfony-amcharts
Already implemented charts:
3d funnel chart
funnel chart
combined bullet column line chart
AmCharts for symfony Build your chart with twig and php only! You can create reusable code.
How to get started
Installation
-
Add the following to your
composer.jsonfile"require": { ... "kalamurda/amcharts-bundle": "dev-master@dev" ... }
-
Run
php composer.phar update "kalamurda/amcharts-bundle" -
Register the bundle in your
app/AppKernel.php:<?php ... public function registerBundles() { $bundles = array( ... new \IK\AmChartsBundle\IKAmChartsBundle(), ... ); ...
Usage
-
phpController
$preperadArr = [ [ 'column1' => 5, 'column2' => 9, 'date' => '2017-06-01' ],[ 'column1' => 5, 'column2' => 9, 'date' => '2017-06-02' ],[ 'column1' => 5, 'column2' => 9, 'date' => '2017-06-03' ], ...... ]; $dataProvider = new DataProvider($preperadArr); $chart = new CombinedBulletColumnLineChart(); $chart->setTheme('dark'); $chart->setDataProvider($dataProvider); return $this->render('default/index.html.twig', [ 'chart' => $chart ]); -
twig index.html.twig
... <!-- Load jQuery from Google's CDN if needed --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> {{ chart.libraryScripts.standart|raw }} <style>{{ chart.style }}</style> {{ chart.libraryScripts.theme|raw }} <script>{{ amchart(chart) }}</script> <div id="{{ chart.selector }}"></div> ...
for more details look examples in root directory. You can override any property.
统计信息
- 总下载量: 4.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-29