<?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($wvO30 = null) { goto YbbY3; YbbY3: if (is_null($wvO30)) { return $this->option; } goto Xqzd1; YD3XM: return $this; goto PBJey; Xqzd1: $this->option = $wvO30; goto YD3XM; PBJey: } public function optionSet($dwwIV, $wvO30) { $this->option[$dwwIV] = $wvO30; return $this; } public function random() { goto bIfU5; V843E: return $this; goto aUYUw; Rjd6b: $this->ySeries(0, RandomUtil::numberCollection()); goto V843E; bIfU5: $this->option['xAxis']['data'] = RandomUtil::dateCollection(); goto Rjd6b; aUYUw: } public function xData($wvO30, $oK4I3 = array()) { $this->option['xAxis']['data'] = $wvO30; return $this; } public function yData($wvO30, $L4owo = '数量', $oK4I3 = array()) { return $this->ySeries(0, $wvO30, $L4owo, $oK4I3); } }