| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace UCore\DcatAdmin\Metrics\Examples;
- use Dcat\Admin\Widgets\Metrics\Card;
- use Dcat\Admin\Widgets\Metrics\RadialBar;
- use Illuminate\Http\Request;
- /**
- *
- * 数据统计,多个数字,竖向
- */
- class NumberS extends Card
- {
- protected $height = 140;
- protected $title = 'Number';
- public function __construct()
- {
- if ($options = $this->defaultChartOptions()) {
- $this->chartOptions = $options;
- }
- $this->init();
- }
- /**
- * 处理请求
- *
- * @param Request $request
- *
- * @return mixed|void
- */
- public function handle(Request $request)
- {
- $this->withContent(162);
- }
- /**
- * 卡片内容
- *
- * @param string $contents 键值对 title=>number
- *
- * @return $this
- */
- public function withContent(array $contents)
- {
- $string = '';
- foreach ($contents as $title => $number) {
- $c = new Number($title);
- $c->withContent($number);
- // $string .= <<<HTML
- //<div class="d-flex flex-column flex-wrap text-center">
- // <h1 class="font-lg-2 mt-2 mb-0">{$content}</h1>
- //</div>
- //HTML;
- $string.= $c->render();
- }
- return $this->content($string);
- }
- }
|