You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
850 B
35 lines
850 B
<?php |
|
|
|
namespace App\Admin\Metrics\Chart; |
|
use Dcat\Admin\Widgets\ApexCharts\Chart; |
|
|
|
class Registering extends Chart |
|
{ |
|
//饼状图(测试用) |
|
public function __construct($containerSelector = null, $options = []) |
|
{ |
|
parent::__construct($containerSelector, $options); |
|
|
|
$this->setUpOptions(); |
|
} |
|
|
|
|
|
//初始化方法,主要是调用$this->options()方法,执行整个option的初始化操作。 |
|
protected function setUpOptions() |
|
{ |
|
$this->options([ |
|
"chart"=>[ |
|
"width"=>380, |
|
"type"=>"pie" |
|
], |
|
]); |
|
|
|
// 执行你的数据查询逻辑 |
|
$data = [44, 55, 13, 43, 22]; |
|
$label = ['Team A', 'Team B', 'Team C', 'Team D', 'Team E']; |
|
|
|
$this->option("series",$data); |
|
$this->option("labels",$label); |
|
|
|
} |
|
}
|
|
|