<?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($Gttsd = null) { goto mrvZG; pTQyr: $this->option = $Gttsd; goto o026J; o026J: return $this; goto iWObj; mrvZG: if (is_null($Gttsd)) { return $this->option; } goto pTQyr; iWObj: } public function optionSet($jPfeB, $Gttsd) { $this->option[$jPfeB] = $Gttsd; return $this; } public function random() { goto dxQDT; dxQDT: $this->option['xAxis']['data'] = RandomUtil::dateCollection(); goto uuqDt; uuqDt: $this->ySeries(0, RandomUtil::numberCollection()); goto hlBpm; hlBpm: return $this; goto NmWgQ; NmWgQ: } public function xData($Gttsd, $qHLCM = array()) { $this->option['xAxis']['data'] = $Gttsd; return $this; } public function yData($Gttsd, $sQIr6 = '数量', $qHLCM = array()) { return $this->ySeries(0, $Gttsd, $sQIr6, $qHLCM); } }