|
|
|
@ -61,12 +61,15 @@ class AllNewFollowSpeciality extends Round
@@ -61,12 +61,15 @@ class AllNewFollowSpeciality extends Round
|
|
|
|
|
// 女生 |
|
|
|
|
$girl = $all[2] ?? 0; |
|
|
|
|
|
|
|
|
|
$manPercent = $total != 0 ? number_format(($man /$total) * 100) : 0; |
|
|
|
|
$girlPercent = $total != 0 ? number_format(($girl / $total) * 100) : 0; |
|
|
|
|
// 卡片内容 |
|
|
|
|
$this->withContent($total, $man, $girl)->height('220px'); |
|
|
|
|
$this->chartLabels(['男生', '女生']); |
|
|
|
|
// 图表数据 |
|
|
|
|
$this->withChart([$man, $girl]); |
|
|
|
|
$this->withChart([$manPercent, $girlPercent]); |
|
|
|
|
// 总数 |
|
|
|
|
$this->chartTotal('总人数', $total); |
|
|
|
|
// 卡片内容 |
|
|
|
|
$this->withContent($total, $man, $girl); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -77,7 +80,7 @@ class AllNewFollowSpeciality extends Round
@@ -77,7 +80,7 @@ class AllNewFollowSpeciality extends Round
|
|
|
|
|
*/ |
|
|
|
|
public function withChart(array $data) |
|
|
|
|
{ |
|
|
|
|
$this->chartColors(['#586cb1', '#dda451', '#ea5455']); |
|
|
|
|
$this->chartColors(['#dda451', '#ea5455']); |
|
|
|
|
return $this->chart([ |
|
|
|
|
'series' => $data, |
|
|
|
|
]); |
|
|
|
|