<?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($Mczr_ = null) { goto LH8_W; KBqYI: return $this; goto mhZzl; hkJDi: $this->option = $Mczr_; goto KBqYI; LH8_W: if (is_null($Mczr_)) { return $this->option; } goto hkJDi; mhZzl: } public function optionSet($l6tBV, $Mczr_) { $this->option[$l6tBV] = $Mczr_; return $this; } public function random() { goto upbkY; upbkY: $this->option['xAxis']['data'] = RandomUtil::dateCollection(); goto xauJB; xauJB: $this->ySeries(0, RandomUtil::numberCollection()); goto pOoLZ; pOoLZ: return $this; goto guo95; guo95: } public function xData($Mczr_, $ACVUe = array()) { $this->option['xAxis']['data'] = $Mczr_; return $this; } public function yData($Mczr_, $ZZMEd = '数量', $ACVUe = array()) { return $this->ySeries(0, $Mczr_, $ZZMEd, $ACVUe); } }