Yii1.1 Echarts百度图表小工具

网友投稿 838 2022-11-04

Yii1.1 Echarts百度图表小工具

Yii1.1 Echarts百度图表小工具

Yii Echarts Widget

yii-echarts

Yii1.1 Echarts百度图表小工具

Requirements

Yii 1.1 or abovePHP 5.4 or above

Installation

Extract the release file under protected/extensions/

Usage

To use this widget, you may insert the following code into a view file:

Array key support

$options = [ 'title' => [ 'text' => '统计图标题', 'textStyle' => ['color' => '#000000', 'fontSize' => '13'], 'top' => '0' ], 'tooltip' => ['show' => true, 'trigger' => 'axis'], 'legend' => [ 'data' => ['统计A','统计B','统计C','统计D','统计E','统计F'], 'bottom' => '0' ], 'toolbox' => [ 'show' => true, 'feature' => [ 'dataView' => ['readOnly' => false], 'magicType' => ['type' => ['line', 'bar']], 'restore' => [], 'saveAsImage' => [], ] ], 'xAxis' => [ array( 'name' => 'x坐标轴', 'type' => 'category', 'data' => ["产品A","产品B","产品C","产品D","产品E","产品F"] ) ], 'yAxis' => [ [ 'name' => 'y坐标轴', 'type' => 'value', 'axisLabel' => ['formatter' => '{value}(件)'] ] ], 'series' => [ [ 'name' => '统计A', 'type' => 'bar', 'data' => [10, 20, 30, 40, 50, 60] ], [ 'name' => '统计B', 'type' => 'bar', 'data' => [55, 12, 33, 60, 20, 75] ], [ 'name' => '统计C', 'type' => 'bar', 'data' => [5, 65, 25, 12, 12, 55] ], [ 'name' => '统计D', 'type' => 'bar', 'data' => [65, 25, 95, 5, 15, 25] ], [ 'name' => '统计E', 'type' => 'bar', 'data' => [15, 26, 44, 65, 65, 15] ], [ 'name' => '统计F', 'type' => 'bar', 'data' => [8, 95, 105, 115, 125, 135] ], ], 'color' => ['#EEAAEE','#7CB5EC','#F7A35C', '#90EE7E', '#7798BF', '#FF0066', '#AAEEEE', '#bda29a','#6e7074', '#546570', '#c4ccd3']];$this->widget('ext.yii-echarts.EchartsWidget',[ 'htmlOptions' => ['style' => 'height:400px'], //注意:必须定义表图div容器的高度,才可以显示表图,否则不显示 'options' => $options]);

说明:具体的参数使用参照 http://echarts.baidu.com/option.html#title 配置项手册

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:DUXCMS- 中小网站管理系统
下一篇:正则表达式详细规则
相关文章

 发表评论

暂时没有评论,来抢沙发吧~