<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget\Chart; use ModStart\Core\Util\RandomUtil; use ModStart\Widget\AbstractWidget; use ModStart\Widget\Traits\DSTrait; class Chart extends AbstractWidget { use DSTrait; protected $view = 'modstart::widget.chart'; protected $height = 300; protected $option = array('grid' => array('right' => '1%', 'left' => '1%', 'bottom' => '10%', 'containLabel' => true), 'toolbox' => array('feature' => array('dataView' => array('show' => true, 'readOnly' => false), 'restore' => array('show' => true), 'saveAsImage' => array('show' => true))), 'tooltip' => array('trigger' => 'axis', 'axisPointer' => array('type' => 'shadow', 'snap' => true, 'crossStyle' => array('color' => '#999'))), 'legend' => array('data' => array()), 'xAxis' => array('type' => 'category', 'data' => array()), 'yAxis' => array('type' => 'value', 'minInterval' => 1), 'series' => array()); public function __construct() { parent::__construct(); } protected function variables() { return array('option' => $this->option, 'height' => $this->height); } public static function make() { return new static(); } public function option($HDpl6 = null) { goto oEobl; nGgTg: return $this; goto KWflQ; oEobl: if (is_null($HDpl6)) { return $this->option; } goto JBLuc; JBLuc: $this->option = $HDpl6; goto nGgTg; KWflQ: } public function optionSet($VFU9l, $HDpl6) { $this->option[$VFU9l] = $HDpl6; return $this; } public function random() { goto vTcNe; Er3j5: $this->ySeries(0, RandomUtil::numberCollection()); goto OsLN3; vTcNe: $this->option['xAxis']['data'] = RandomUtil::dateCollection(); goto Er3j5; OsLN3: return $this; goto wPILp; wPILp: } public function xData($HDpl6, $AXgEz = array()) { $this->option['xAxis']['data'] = $HDpl6; return $this; } public function yData($HDpl6, $f0dxO = '数量', $AXgEz = array()) { return $this->ySeries(0, $HDpl6, $f0dxO, $AXgEz); } }