<?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($ib3B9 = null) { goto P5J3y; P5J3y: if (is_null($ib3B9)) { return $this->option; } goto D0VuD; D0VuD: $this->option = $ib3B9; goto zYLIP; zYLIP: return $this; goto dVYqi; dVYqi: } public function optionSet($GUcFO, $ib3B9) { $this->option[$GUcFO] = $ib3B9; return $this; } public function random() { goto J0JG5; J0JG5: $this->option['xAxis']['data'] = RandomUtil::dateCollection(); goto jG8Pq; jG8Pq: $this->ySeries(0, RandomUtil::numberCollection()); goto kwZ7_; kwZ7_: return $this; goto bxLHc; bxLHc: } public function xData($ib3B9, $pmJAc = array()) { $this->option['xAxis']['data'] = $ib3B9; return $this; } public function yData($ib3B9, $XggBq = '数量', $pmJAc = array()) { return $this->ySeries(0, $ib3B9, $XggBq, $pmJAc); } }