定制 hzhihua/yii2-frappe-charts 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hzhihua/yii2-frappe-charts

Composer 安装命令:

composer require hzhihua/yii2-frappe-charts

包简介

yii2 svg charts

README 文档

README

frappe-charts frappe-charts-demo

预览图

安装

composer require hzhihua/yii2-frappe-charts

使用

在模板中添加html标签

<div id="chart"></div>

调用 Charts widget

<? \hzhihua\frappe\Charts::widget([
    //'view' => 'yii\web\View', // or $this, your customize view class/object, it must be extends [[yii\web\View]], default Yii::$app->getView()
    //'instance_var_name' => 'chart', // var chart = new Chart({});
    //'instance_var_name_keyword' => 'var', // var chart = new Chart({});
    //'asset' => 'hzhihua\\frappe\\ChartsAsset', // asset source class
    
    'selector' => '#chart',
    'config' => [
        'height' => 250,
        'title' => "My Chart",
        'type' => 'bar', // 'axis-mixed' or 'bar', 'line', 'pie', 'percentage'
        'colors' => ['#7cd6fd', '#743ee2'],
        'format_tooltip_x' => new \yii\web\JsExpression('d => (d + \'\').toUpperCase()'), // 将生成原生js代码 d => (d + '').toUpperCase()
        'data' => [
            'labels' => ["12am-3am", "3am-6pm", "6am-9am", "9am-12am", "12pm-3pm", "3pm-6pm", "6pm-9pm", "9am-12am"
            ],
            'datasets' => [
                [
                    'name' => "Some Data",
                    'axisPosition' => 'right',
                    'values' => [25, 40, 30, 35, 8, 52, 17, -4],
                ],
                [
                    'name' => "Another Set",
                    'chartType' => 'line',
                    'values' => [25, 50, -10, 15, 18, 32, 27, 14],
                ],
            ],
        ],
    ],
    'other' => new \yii\web\JsExpression('console.log(chart)'),
    // @see https://frappe.github.io/charts/
    // @see \hzhihua\frappe\Charts for detail configuration info
]);?>

统计信息

  • 总下载量: 62
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-12-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固