我想用海图做邮件发送报告。这是我已经创建的图表。
18,19,20。。。是电子邮件的id。所以图表显示了所有的电子邮件报告。但我想显示每个电子邮件id的图表。
报表.php
<?php
use dosamigos\highcharts\HighCharts;
use backend\models\Email;
$this->title = 'Megablast Statistics';
foreach($dreport as $values) {
$a[0]= ($values['email_id']);
$c[]= ($values['email_id']);
$b[]= array('type'=> 'column', 'name' =>$values['email_id'], 'data' => array((int)$values['number_of_recipient'],
(int)$values['number_of_delivery'],(int)$values['number_of_open'], (int)$values['number_of_click'], (int)$values['number_of_complain'], (int)$values['number_of_bounces']) );
}
echo
Highcharts::widget([
'clientOptions' => [
'chart'=>[
'type'=>'pie'
],
'title' => ['text' => 'Megablast Statistics'],
'xAxis' => [
'categories' => ['number_of_recipient', 'number_of_delivery', 'number_of_open', 'number_of_click', 'number_of_complain', 'number_of_bounces']
],
'yAxis' => [
'title' => ['subject' => '']
],
'series' => $b
]
]);
电子邮件控制器.php
public function actionReport()
{
$data = Yii::$app->db->createCommand('select email_id,
number_of_recipient,
number_of_delivery,
number_of_open,
number_of_click,
number_of_complain,
number_of_bounces
from email
group by email_id')->queryAll();
//print_r($data);
return $this->render('report', [
'dreport' => $data
]);
}
这是数据库
谢谢:)
暂无答案!
目前还没有任何答案,快来回答吧!