<?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($mdHu1 = null) { goto T20mh; l0MvT: return $this; goto ml30C; yQ0f5: $this->option = $mdHu1; goto l0MvT; T20mh: if (is_null($mdHu1)) { return $this->option; } goto yQ0f5; ml30C: } public function optionSet($HQKqq, $mdHu1) { $this->option[$HQKqq] = $mdHu1; return $this; } public function random() { goto f0SLk; f0SLk: $this->option['xAxis']['data'] = RandomUtil::dateCollection(); goto pGqVZ; nxv4w: return $this; goto oH78E; pGqVZ: $this->ySeries(0, RandomUtil::numberCollection()); goto nxv4w; oH78E: } public function xData($mdHu1, $pFM9U = array()) { $this->option['xAxis']['data'] = $mdHu1; return $this; } public function yData($mdHu1, $c6VKG = '数量', $pFM9U = array()) { return $this->ySeries(0, $mdHu1, $c6VKG, $pFM9U); } }